Custom TKey

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Royal

    Custom TKey

    On my web site, i have a collection of items that a user could click on. I
    originally had a dictionary that kept a key,item list, but now it's grown
    more complicated as "new information about what the customer is selling" has
    come in.

    Long story short, I was looking for a way to have a dictionary use a key
    that I defined.

    example:

    instead of Dictionary<stri ng, object>,

    I wanted to have:

    Dictionary<cust omTypeIDefine, objecttestDict( );

    I was able to create a dictionary and add items in by using:

    testDict.add(ne w customTypeIDefi ne("boo", Style.Left), new
    MySpecialObject ()),

    but it doesn't seem to be able to lookup the values and find them. I'm
    guessing it's because somewhere I need to define or implement some
    interfaces for the TKey type I've defined.

    Is there an article/reference/list of what I need to implement for a TKey to
    be usable in this situation?

    Thanks for any assistance.

    Tim Royal


  • Munna

    #2
    Re: Custom TKey

    On Jun 3, 6:52 am, "Tim Royal" <tim.ro...@sier raonline.comwro te:
    On my web site, i have a collection of items that a user could click on. I
    originally had a dictionary that kept a key,item list, but now it's grown
    more complicated as "new information about what the customer is selling" has
    come in.
    >
    Long story short, I was looking for a way to have a dictionary use a key
    that I defined.
    >
    example:
    >
    instead of Dictionary<stri ng, object>,
    >
    I wanted to have:
    >
    Dictionary<cust omTypeIDefine, objecttestDict( );
    >
    I was able to create a dictionary and add items in by using:
    >
    testDict.add(ne w customTypeIDefi ne("boo", Style.Left), new
    MySpecialObject ()),
    >
    but it doesn't seem to be able to lookup the values and find them. I'm
    guessing it's because somewhere I need to define or implement some
    interfaces for the TKey type I've defined.
    >
    Is there an article/reference/list of what I need to implement for a TKey to
    be usable in this situation?
    >
    Thanks for any assistance.
    >
    Tim Royal
    Hi

    Check out this posts




    Best of luck

    Munna



    Comment

    • Tim Royal

      #3
      Re: Custom TKey

      FANTASTIC! Thank you very much for the link! It's exactly what I needed.

      Tim

      "Munna" <munnaonc@gmail .comwrote in message
      news:242ab0d2-7d58-42a3-8e4b-f12d2ca3250b@t1 2g2000prg.googl egroups.com...
      On Jun 3, 6:52 am, "Tim Royal" <tim.ro...@sier raonline.comwro te:
      >On my web site, i have a collection of items that a user could click on.
      >I
      >originally had a dictionary that kept a key,item list, but now it's grown
      >more complicated as "new information about what the customer is selling"
      >has
      >come in.
      >>
      >Long story short, I was looking for a way to have a dictionary use a key
      >that I defined.
      >>
      >example:
      >>
      >instead of Dictionary<stri ng, object>,
      >>
      >I wanted to have:
      >>
      >Dictionary<cus tomTypeIDefine, objecttestDict( );
      >>
      >I was able to create a dictionary and add items in by using:
      >>
      >testDict.add(n ew customTypeIDefi ne("boo", Style.Left), new
      >MySpecialObjec t()),
      >>
      >but it doesn't seem to be able to lookup the values and find them. I'm
      >guessing it's because somewhere I need to define or implement some
      >interfaces for the TKey type I've defined.
      >>
      >Is there an article/reference/list of what I need to implement for a TKey
      >to
      >be usable in this situation?
      >>
      >Thanks for any assistance.
      >>
      >Tim Royal
      >
      Hi
      >
      Check out this posts
      >


      >
      Best of luck
      >
      Munna


      www.shatkotha.com

      Comment

      Working...