/[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 104 by william, Sun Mar 10 11:08:58 2013 UTC revision 105 by william, Sun Mar 10 11:35:26 2013 UTC
# Line 9  namespace libxmltv.Core Line 9  namespace libxmltv.Core
9      public class PropertyList : PropertyList<string, object>, IPropertyList      public class PropertyList : PropertyList<string, object>, IPropertyList
10      {      {
11          public PropertyList() :base() { }          public PropertyList() :base() { }
12          public PropertyList(IEnumerable<PropertyValuePair<string, object>> collection) : base(collection) { }          public PropertyList(IEnumerable<IPropertyValuePair<string, object>> collection) : base(collection) { }
13          public PropertyList(int capacity) : base(capacity) { }          public PropertyList(int capacity) : base(capacity) { }
14      }      }
15      public class PropertyList<TKey, TValue> : IPropertyList<TKey, TValue>      public class PropertyList<TKey, TValue> : IPropertyList<TKey, TValue>
16      {      {
17          private PropertyCollection<PropertyValuePair<TKey, TValue>> properties;          private PropertyCollection<IPropertyValuePair<TKey, TValue>> properties;
18          public PropertyList() { properties = new PropertyCollection<PropertyValuePair<TKey, TValue>>(); }          public PropertyList() { properties = new PropertyCollection<IPropertyValuePair<TKey, TValue>>(); }
19          public PropertyList(IEnumerable<PropertyValuePair<TKey, TValue>> collection) : this() { foreach (var p in collection) { properties.AddProperty(p); } }          public PropertyList(IEnumerable<IPropertyValuePair<TKey, TValue>> collection) : this() { foreach (var p in collection) { properties.AddProperty(p); } }
20          public PropertyList(int capacity)          public PropertyList(int capacity)
21          {          {
22              properties = new PropertyCollection<PropertyValuePair<TKey, TValue>>();              properties = new PropertyCollection<IPropertyValuePair<TKey, TValue>>();
23          }          }
24          public PropertyValuePair<TKey, TValue> this[int index] { get { return properties.ToList()[index]; } set { properties.ToList()[index] = value; } }          public IPropertyValuePair<TKey, TValue> this[int index] { get { return properties.ToList()[index]; } set { properties.ToList()[index] = value; } }
25          public IEnumerable<PropertyValuePair<TKey, TValue>> this[TKey name]          public IEnumerable<IPropertyValuePair<TKey, TValue>> this[TKey name]
26          {          {
27              get              get
28              {              {
# Line 34  namespace libxmltv.Core Line 34  namespace libxmltv.Core
34                  return list;                  return list;
35              }              }
36          }          }
37          public int IndexOfProperty(PropertyValuePair<TKey, TValue> item) { return properties.ToList().IndexOf(item); }          public int IndexOfProperty(IPropertyValuePair<TKey, TValue> item) { return properties.ToList().IndexOf(item); }
38          public void InsertPropertyAtIndex(int index, PropertyValuePair<TKey, TValue> item) { properties.ToList().Insert(index, item); }          public void InsertPropertyAtIndex(int index, IPropertyValuePair<TKey, TValue> item) { properties.ToList().Insert(index, item); }
39          public void RemovePropertyAt(int index) { properties.RemoveProperty(this[index]); }          public void RemovePropertyAt(int index) { properties.RemoveProperty(this[index]); }
40          public int PropertyCount { get { return properties.PropertyCount; } }          public int PropertyCount { get { return properties.PropertyCount; } }
41          public bool IsReadOnly          public bool IsReadOnly
# Line 50  namespace libxmltv.Core Line 50  namespace libxmltv.Core
50                  return collection.IsReadOnly;                  return collection.IsReadOnly;
51              }              }
52          }          }
53          public void AddProperty(PropertyValuePair<TKey, TValue> item) { properties.AddProperty(item); }          public void AddProperty(IPropertyValuePair<TKey, TValue> item) { properties.AddProperty(item); }
54          public void ClearProperties() { properties.ClearProperties(); }          public void ClearProperties() { properties.ClearProperties(); }
55          public bool ContainsProperty(PropertyValuePair<TKey, TValue> item) { return properties.Contains(item); }          public bool ContainsProperty(IPropertyValuePair<TKey, TValue> item) { return properties.Contains(item); }
56          public void CopyPropertiesTo(PropertyValuePair<TKey, TValue>[] array, int arrayIndex) { properties.CopyPropertiesTo(array, arrayIndex); }          public void CopyPropertiesTo(IPropertyValuePair<TKey, TValue>[] array, int arrayIndex) { properties.CopyPropertiesTo(array, arrayIndex); }
57          public bool RemoveProperty(PropertyValuePair<TKey, TValue> item) { return properties.RemoveProperty(item); }          public bool RemoveProperty(IPropertyValuePair<TKey, TValue> item) { return properties.RemoveProperty(item); }
58          public IEnumerator<PropertyValuePair<TKey, TValue>> GetEnumerator() { return properties.GetEnumerator(); }          public IEnumerator<IPropertyValuePair<TKey, TValue>> GetEnumerator() { return properties.GetEnumerator(); }
59          System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this.GetEnumerator(); }          System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this.GetEnumerator(); }
60    
61    

Legend:
Removed from v.104  
changed lines
  Added in v.105

  ViewVC Help
Powered by ViewVC 1.1.22