/[xmltv_parser]/trunk/libxmltv/Core/PropertyDictionary.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/PropertyDictionary.cs

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

--- trunk/libxmltv/Core/PropertyDictionary.cs	2013/03/10 11:35:26	105
+++ trunk/libxmltv/Core/PropertyDictionary.cs	2013/03/10 14:28:57	110
@@ -10,7 +10,7 @@
 
 namespace libxmltv.Core
 {
-
+    [Serializable]
     public class PropertyCollection<T> : IPropertyCollection<T>
     {
         private List<T> items = new List<T>();
@@ -38,7 +38,13 @@
         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);
+        }
     }
+    [Serializable]
     public class PropertyDictionary : PropertyDictionary<string, object>, IPropertyDictionary
     {
         public PropertyDictionary() : base() { }
@@ -49,6 +55,7 @@
         public PropertyDictionary(int capacity, IEqualityComparer<string> comparer) : base(capacity, comparer) { }
         protected PropertyDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
+    [Serializable]
     public class PropertyDictionary<TKey, TValue> : IPropertyDictionary<TKey, TValue>
     {
         [StructLayout(LayoutKind.Sequential)]
@@ -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