/[xmltv_parser]/trunk/libxmltv/Interfaces/Interfaces.cs
ViewVC logotype

Diff of /trunk/libxmltv/Interfaces/Interfaces.cs

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

revision 91 by william, Sat Mar 9 17:48:02 2013 UTC revision 92 by william, Sun Mar 10 08:21:30 2013 UTC
# Line 7  using System.Xml.Linq; Line 7  using System.Xml.Linq;
7  using libxmltv.Core;  using libxmltv.Core;
8  using System.ComponentModel;  using System.ComponentModel;
9  using System.Collections;  using System.Collections;
10    using System.Runtime.InteropServices;
11    
12  namespace libxmltv.Interfaces  namespace libxmltv.Interfaces
13  {  {
# Line 101  namespace libxmltv.Interfaces Line 102  namespace libxmltv.Interfaces
102    
103  #region Property Dictionary support  #region Property Dictionary support
104      public interface IPropertyDictionary : IPropertyDictionary<string,object> { }      public interface IPropertyDictionary : IPropertyDictionary<string,object> { }
105      public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable      public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<PropertyValuePair<TKey, TValue>>, IEnumerable<PropertyValuePair<TKey, TValue>>, IEnumerable
106      {      {
107          IPropertyCollection<TKey> PropertyKeys { get; }          IPropertyCollection<TKey> PropertyKeys { get; }
108          IPropertyCollection<TValue> PropertyValues { get; }                  IPropertyCollection<TValue> PropertyValues { get; }        
# Line 122  namespace libxmltv.Interfaces Line 123  namespace libxmltv.Interfaces
123          bool RemoveProperty(T item);          bool RemoveProperty(T item);
124      }      }
125  #endregion  #endregion
126    #region Property List support
127        public interface IPropertyList : IPropertyList<PropertyValuePair<string, object>> { }
128        public interface IPropertyList<T> : IPropertyCollection<T>, IEnumerable<List<T>>, IEnumerable
129        {
130            T this[int index] { get; set; }
131            int IndexOfProperty(T item);
132            void InsertPropertyAtIndex(int index, T item);
133            void RemovePropertyAt(int index);
134        }
135    #endregion
136    
137        #region PropertyValuePair support
138        public struct PropertyValuePair<TKey, TValue>
139        {
140            #region KeyValuePair support
141            public static implicit operator PropertyValuePair<TKey, TValue>(KeyValuePair<TKey, TValue> i) { return new PropertyValuePair<TKey, TValue>(i.Key, i.Value); }
142            public static implicit operator KeyValuePair<TKey, TValue>(PropertyValuePair<TKey, TValue> i) { return new KeyValuePair<TKey, TValue>(i.Name, i.Value); }
143            #endregion
144            public PropertyValuePair(TKey name, TValue value)
145            {
146                this.name = name;
147                this.value = value;
148            }
149            private TKey name;
150            public TKey Name { get { return this.name; } }
151            private TValue value;
152            public TValue Value { get { return this.value; } }
153            public override string ToString()
154            {
155                StringBuilder builder = new StringBuilder();
156                builder.Append('[');
157                if (this.Name != null)
158                {
159                    builder.Append(this.Name.ToString());
160                }
161                builder.Append(", ");
162                if (this.Value != null)
163                {
164                    builder.Append(this.Value.ToString());
165                }
166                builder.Append(']');
167                return builder.ToString();
168    
169            }
170        }
171        #endregion
172    
173  }  }

Legend:
Removed from v.91  
changed lines
  Added in v.92

  ViewVC Help
Powered by ViewVC 1.1.22