/[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 105 by william, Sun Mar 10 11:35:26 2013 UTC revision 118 by william, Sun Mar 10 17:41:52 2013 UTC
# Line 6  using libxmltv.Interfaces; Line 6  using libxmltv.Interfaces;
6    
7  namespace libxmltv.Core  namespace libxmltv.Core
8  {  {
9      public class PropertyList : PropertyList<string, object>, IPropertyList      [Serializable]
10        internal class PropertyList : PropertyList<string, object>, IPropertyList
11      {      {
12          public PropertyList() :base() { }          public PropertyList() :base() { }
13          public PropertyList(IEnumerable<IPropertyValuePair<string, object>> collection) : base(collection) { }          public PropertyList(IEnumerable<IPropertyValuePair<string, object>> collection) : base(collection) { }
14          public PropertyList(int capacity) : base(capacity) { }          public PropertyList(int capacity) : base(capacity) { }
15      }      }
16      public class PropertyList<TKey, TValue> : IPropertyList<TKey, TValue>      [Serializable]
17        internal class PropertyList<TKey, TValue> : IPropertyList<TKey, TValue>
18      {      {
19          private PropertyCollection<IPropertyValuePair<TKey, TValue>> properties;          private PropertyCollection<IPropertyValuePair<TKey, TValue>> properties;
20          public PropertyList() { properties = new PropertyCollection<IPropertyValuePair<TKey, TValue>>(); }          public PropertyList() { properties = new PropertyCollection<IPropertyValuePair<TKey, TValue>>(); }
# Line 42  namespace libxmltv.Core Line 44  namespace libxmltv.Core
44          {          {
45              get              get
46              {              {
47                  IPropertyCollection<PropertyValuePair<TKey, TValue>> collection = (properties as IPropertyCollection<PropertyValuePair<TKey, TValue>>);                  IPropertyCollection<IPropertyValuePair<TKey, TValue>> collection = (properties as IPropertyCollection<IPropertyValuePair<TKey, TValue>>);
48                  if(collection == null)                  if(collection == null)
49                  {                  {
50                      throw new InvalidCastException(string.Format("Unable to cast: '{0}' to '{1}'", properties.GetType().Name, typeof(IPropertyCollection<PropertyValuePair<TKey, TValue>>).Name));                      throw new InvalidCastException(string.Format("Unable to cast: '{0}' to '{1}'", properties.GetType().Name, typeof(IPropertyCollection<PropertyValuePair<TKey, TValue>>).Name));
# Line 62  namespace libxmltv.Core Line 64  namespace libxmltv.Core
64          public bool ContainsProperty(TKey name, TValue value) { return ContainsProperty(new PropertyValuePair<TKey, TValue>(name, value)); }          public bool ContainsProperty(TKey name, TValue value) { return ContainsProperty(new PropertyValuePair<TKey, TValue>(name, value)); }
65          public void AddProperty(TKey name, TValue value) { AddProperty(new PropertyValuePair<TKey, TValue>(name, value)); }          public void AddProperty(TKey name, TValue value) { AddProperty(new PropertyValuePair<TKey, TValue>(name, value)); }
66          public void RemoveProperty(TKey name, TValue value) { RemoveProperty(new PropertyValuePair<TKey, TValue>(name, value)); }          public void RemoveProperty(TKey name, TValue value) { RemoveProperty(new PropertyValuePair<TKey, TValue>(name, value)); }
67    
68            public override string ToString()
69            {
70                return string.Format("Property Count: {0}", PropertyCount);
71            }
72      }      }
73  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.22