/[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

--- trunk/libxmltv/Core/PropertyList.cs	2013/03/10 10:18:06	99
+++ trunk/libxmltv/Core/PropertyList.cs	2013/03/10 10:34:07	100
@@ -22,6 +22,22 @@
             properties = new PropertyCollection<PropertyValuePair<TKey, TValue>>();
         }
         public PropertyValuePair<TKey, TValue> this[int index] { get { return properties.ToList()[index]; } set { properties.ToList()[index] = value; } }
+        public IEnumerable<PropertyValuePair<TKey, TValue>> this[TKey name] 
+        {
+            get
+            {
+                var list = properties.ToList().FindAll(s => s.Name.Equals(name));
+                if (list == null)
+                {
+                    throw new NullReferenceException(string.Format("Could not find any properties named '{0}'", name));
+                }
+                return list;
+            }
+            //set
+            //{
+            //    var list = value;
+            //}
+        }
         public int IndexOfProperty(PropertyValuePair<TKey, TValue> item) { return properties.ToList().IndexOf(item); }
         public void InsertPropertyAtIndex(int index, PropertyValuePair<TKey, TValue> item) { properties.ToList().Insert(index, item); }
         public void RemovePropertyAt(int index) { properties.RemoveProperty(this[index]); }

 

  ViewVC Help
Powered by ViewVC 1.1.22