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

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

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

--- trunk/libxmltv/Core/ExtraMetaData.cs	2013/03/10 11:35:26	105
+++ trunk/libxmltv/Core/ExtraMetaData.cs	2013/03/10 12:25:54	106
@@ -3,12 +3,35 @@
 using System.Linq;
 using System.Text;
 using libxmltv.Interfaces;
+using System.Xml.Linq;
 
 namespace libxmltv.Core
 {
-    internal class ExtraMetaData : IExtraMetaData
+    internal class ExtraMetaData : ExtraMetaData<XElement>, IExtraMetaData
     {
-        #region IExtraMetaData memebers
+        public ExtraMetaData() : base() { }
+        public ExtraMetaData(XElement value) : base(value) { }
+    }
+    internal class ExtraMetaData<TValue> : IExtraMetaData<TValue>
+        where TValue: XElement
+    {
+        public ExtraMetaData() : this(default(TValue)) { }
+        public ExtraMetaData(TValue value) 
+        {
+            if (value == null) { throw new ArgumentNullException("value", "cannot be null"); }
+            if (value.Name == null) { throw new ArgumentNullException("value.Name", "cannot be null"); }
+            this.Name = value.Name.ToString(); 
+            this.Value = value; 
+        }
+        #region IExtraMetaData<TKey,TValue> memebers
         #endregion
+        private string _name;
+        public string Name { get { return _name; } protected set { _name = value; } }
+        private TValue _value;
+        public TValue Value { get { return _value; } protected set { _value = value; } }
+        public override string ToString()
+        {
+            return string.Format("{0}", this.Name);
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22