code_junkie

Returning multiple values

Nov 13th, 2011
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Dictionary<int, Collection<Rectangle>> GetDocumentCoordinates(int DocumentId)
  2.  
  3. Dictionary<int, PageInfo> GetDocumentAttributes(int DocumentId)
  4.  
  5. Dictionary<int, Collection<Rectangle>> GetCoordinates(int DocumentId, ref Dictionary<int, PageInfo> PageAttributes)
  6.  
  7. class DocumentInfo
  8. {
  9. Dictionary<int, Collection<Rectangle>> Coordinates { get; set;}
  10. Dictionary<int, PageInfo> PageAttributes { get; set; }
  11. }
  12.  
  13. DocumentInfo GetDocumentInfo(int DocumentId);
  14.  
  15. class DocumentInfo {
  16. Dictionary<int, Collection<Rectangle>> rectangles = ...
  17. public Collection<Rectangle> GetRectangles(int index) {
  18. return rectangles[index]; // might want to clone to
  19. // protect against mutation
  20. }
  21. Dictionary<int, PageInfo> pages = ...
  22. public PageInfo GetPageInfo(int index) {
  23. return pages[index];
  24. }
  25.  
  26. }
Add Comment
Please, Sign In to add comment