/[xmltv_parser]/trunk/libxmltv/Core/PropertyList.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/PropertyList.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 98 by william, Sun Mar 10 10:13:16 2013 UTC revision 100 by william, Sun Mar 10 10:34:07 2013 UTC
# Line 22  namespace libxmltv.Core Line 22  namespace libxmltv.Core
22              properties = new PropertyCollection<PropertyValuePair<TKey, TValue>>();              properties = new PropertyCollection<PropertyValuePair<TKey, TValue>>();
23          }          }
24          public PropertyValuePair<TKey, TValue> this[int index] { get { return properties.ToList()[index]; } set { properties.ToList()[index] = value; } }          public PropertyValuePair<TKey, TValue> this[int index] { get { return properties.ToList()[index]; } set { properties.ToList()[index] = value; } }
25            public IEnumerable<PropertyValuePair<TKey, TValue>> this[TKey name]
26            {
27                get
28                {
29                    var list = properties.ToList().FindAll(s => s.Name.Equals(name));
30                    if (list == null)
31                    {
32                        throw new NullReferenceException(string.Format("Could not find any properties named '{0}'", name));
33                    }
34                    return list;
35                }
36                //set
37                //{
38                //    var list = value;
39                //}
40            }
41          public int IndexOfProperty(PropertyValuePair<TKey, TValue> item) { return properties.ToList().IndexOf(item); }          public int IndexOfProperty(PropertyValuePair<TKey, TValue> item) { return properties.ToList().IndexOf(item); }
42          public void InsertPropertyAtIndex(int index, PropertyValuePair<TKey, TValue> item) { properties.ToList().Insert(index, item); }          public void InsertPropertyAtIndex(int index, PropertyValuePair<TKey, TValue> item) { properties.ToList().Insert(index, item); }
43          public void RemovePropertyAt(int index) { properties.RemoveProperty(this[index]); }          public void RemovePropertyAt(int index) { properties.RemoveProperty(this[index]); }

Legend:
Removed from v.98  
changed lines
  Added in v.100

  ViewVC Help
Powered by ViewVC 1.1.22