Results 1 to 4 of 4

Thread: [RESOLVED] Store Objects with Key in some sort of Collection/Dictionary

Threaded View

  1. #1

    Thread Starter
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Resolved [RESOLVED] Store Objects with Key in some sort of Collection/Dictionary

    I need to Store Objects with Key like:

    Key: <Fontname & FontSize> / Object: <Font Object>

    Example content:
    Code:
    
    ArialRegular8         | <Corresponding Font Object>
    ImpactItalic10        | <Corresponding Font Object>
    TimesRomanRegular12   | <Corresponding Font Object>
    
    These font types come from an external library, the real type is DocumentFont, I prefer not to store just values and recreate the font object later, so I need to store the object, and i want to be able to call Contains() later without looping.
    I see some possible solutions in the help, like for example Dictionary (of T Key, T Value), is this the best option? Also, to be able to call Contains(), i will have to overload function Contains() using an Interface or this is already built-in in some Collections / Dictionaries when using a String as Key?

    Thanks!
    Last edited by jcis; Jun 10th, 2012 at 05:44 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width