Parent Directory
|
Revision Log
|
Patch
--- trunk/libxmltv/Core/PropertyDictionary.cs 2013/03/10 11:35:26 105 +++ trunk/libxmltv/Core/PropertyDictionary.cs 2013/03/10 17:41:52 118 @@ -10,8 +10,8 @@ namespace libxmltv.Core { - - public class PropertyCollection<T> : IPropertyCollection<T> + [Serializable] + internal class PropertyCollection<T> : IPropertyCollection<T> { private List<T> items = new List<T>(); public PropertyCollection() : this(new List<T>()) { } @@ -38,8 +38,14 @@ public bool RemoveProperty(T item) { return items.Remove(item); } public IEnumerator<T> GetEnumerator() { return items.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return items.GetEnumerator(); } + + public override string ToString() + { + return string.Format("Property Count: {0}", PropertyCount); + } } - public class PropertyDictionary : PropertyDictionary<string, object>, IPropertyDictionary + [Serializable] + internal class PropertyDictionary : PropertyDictionary<string, object>, IPropertyDictionary { public PropertyDictionary() : base() { } public PropertyDictionary(IPropertyDictionary dictionary) : base(dictionary) { } @@ -49,7 +55,8 @@ public PropertyDictionary(int capacity, IEqualityComparer<string> comparer) : base(capacity, comparer) { } protected PropertyDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { } } - public class PropertyDictionary<TKey, TValue> : IPropertyDictionary<TKey, TValue> + [Serializable] + internal class PropertyDictionary<TKey, TValue> : IPropertyDictionary<TKey, TValue> { [StructLayout(LayoutKind.Sequential)] private struct Entry @@ -58,6 +65,10 @@ public int next; public TKey name; public TValue value; + public override string ToString() + { + return new PropertyValuePair<TKey, TValue>(name, value).ToString(); + } } private Entry[] entries { @@ -153,6 +164,10 @@ IEnumerator<IPropertyValuePair<TKey, TValue>> IEnumerable<IPropertyValuePair<TKey, TValue>>.GetEnumerator() { return new PropertyDictionaryEnumerator(this, 2); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return properties.GetEnumerator(); } + public override string ToString() + { + return string.Format("Property Count: {0}", PropertyCount); + } #region enumerator support public class PropertyDictionaryEnumerator : IEnumerator<IPropertyValuePair<TKey, TValue>>, IDisposable {
ViewVC Help | |
Powered by ViewVC 1.1.22 |