ConfigItemCollection Find

  1. #1

    ConfigItemCollection Find

    This is not critical, just a thought.

    I see in the ConfigItemCollection there is a Contains(string name) that returns bool based on finding a ConfigItem with that name. Could an additional method be added to return a ConfigItem or just value based on a string matching the name attribute.

    Currently one of my developers was just performing closedNode.CustomAttributes(0).Value. Since she built the custom attributes she knew the first attribute would always be her "Level" attribute.

    I had her change it to closedNode.CustomAttributes.First(a => a.Name == "Level").Value.

    Would it be better to add a method so she could call it like closedNode.CustomAttributes.Find("Level") or a method like TryGetValue("Level", out Value)?
    Since the ConfigItemCollection is not a dictionary various ConfigItems could have the same name attribute. Would you need to add FindFirst, FindLast, FindAll?

    I initially thought the ConfigItemCollection would be a dictionary until I look at the code.
  2. #2
    Hi Chris,

    We are sorry for the delay.

    Well, yes, the ConfigItemCollection class implements the IListInterface interface, not the IDictionary one.

    I think your solution is very good and totally appropriate.
    closedNode.CustomAttributes.First(a => a.Name == "Level").Value.
    Could you clarify why do you still need something else?

    I think these extension methods could help to achieve any collection-related task.

    Implementing IDictionary methods for the ConfigItemCollection class and many other similar classes in Ext.NET looks bloating.

    What do you think?

Similar Threads

  1. Cannot find AjaxEvents in Ext.net
    By lov_teddy in forum 1.x Help
    Replies: 1
    Last Post: Jan 27, 2011, 1:15 PM
  2. I find a bug in ext.net rc1 treepanel
    By huchaonian in forum 1.x Help
    Replies: 0
    Last Post: Nov 18, 2010, 5:35 AM
  3. Not Find 'DirectEvents'
    By sindevil0010 in forum 1.x Help
    Replies: 2
    Last Post: Aug 12, 2010, 2:36 AM
  4. I can not find the tabstrip why?
    By Fabrizio in forum 1.x Help
    Replies: 3
    Last Post: Jun 15, 2010, 2:49 PM
  5. [CLOSED] Store.find
    By CSG in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 03, 2009, 10:12 AM

Posting Permissions