--- trunk/libxmltv/Interfaces/Interfaces.cs 2013/03/09 17:48:02 91 +++ trunk/libxmltv/Interfaces/Interfaces.cs 2013/03/10 08:21:30 92 @@ -7,6 +7,7 @@ using libxmltv.Core; using System.ComponentModel; using System.Collections; +using System.Runtime.InteropServices; namespace libxmltv.Interfaces { @@ -101,7 +102,7 @@ #region Property Dictionary support public interface IPropertyDictionary : IPropertyDictionary { } - public interface IPropertyDictionary : IPropertyCollection>, IEnumerable>, IEnumerable + public interface IPropertyDictionary : IPropertyCollection>, IEnumerable>, IEnumerable { IPropertyCollection PropertyKeys { get; } IPropertyCollection PropertyValues { get; } @@ -122,4 +123,51 @@ bool RemoveProperty(T item); } #endregion +#region Property List support + public interface IPropertyList : IPropertyList> { } + public interface IPropertyList : IPropertyCollection, IEnumerable>, IEnumerable + { + T this[int index] { get; set; } + int IndexOfProperty(T item); + void InsertPropertyAtIndex(int index, T item); + void RemovePropertyAt(int index); + } +#endregion + + #region PropertyValuePair support + public struct PropertyValuePair + { + #region KeyValuePair support + public static implicit operator PropertyValuePair(KeyValuePair i) { return new PropertyValuePair(i.Key, i.Value); } + public static implicit operator KeyValuePair(PropertyValuePair i) { return new KeyValuePair(i.Name, i.Value); } + #endregion + public PropertyValuePair(TKey name, TValue value) + { + this.name = name; + this.value = value; + } + private TKey name; + public TKey Name { get { return this.name; } } + private TValue value; + public TValue Value { get { return this.value; } } + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + builder.Append('['); + if (this.Name != null) + { + builder.Append(this.Name.ToString()); + } + builder.Append(", "); + if (this.Value != null) + { + builder.Append(this.Value.ToString()); + } + builder.Append(']'); + return builder.ToString(); + + } + } + #endregion + } \ No newline at end of file