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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (hide annotations) (download)
Sun Mar 10 12:25:54 2013 UTC (7 years, 6 months ago) by william
File size: 1334 byte(s)

1 william 105 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using libxmltv.Interfaces;
6 william 106 using System.Xml.Linq;
7 william 105
8     namespace libxmltv.Core
9     {
10 william 106 internal class ExtraMetaData : ExtraMetaData<XElement>, IExtraMetaData
11 william 105 {
12 william 106 public ExtraMetaData() : base() { }
13     public ExtraMetaData(XElement value) : base(value) { }
14     }
15     internal class ExtraMetaData<TValue> : IExtraMetaData<TValue>
16     where TValue: XElement
17     {
18     public ExtraMetaData() : this(default(TValue)) { }
19     public ExtraMetaData(TValue value)
20     {
21     if (value == null) { throw new ArgumentNullException("value", "cannot be null"); }
22     if (value.Name == null) { throw new ArgumentNullException("value.Name", "cannot be null"); }
23     this.Name = value.Name.ToString();
24     this.Value = value;
25     }
26     #region IExtraMetaData<TKey,TValue> memebers
27 william 105 #endregion
28 william 106 private string _name;
29     public string Name { get { return _name; } protected set { _name = value; } }
30     private TValue _value;
31     public TValue Value { get { return _value; } protected set { _value = value; } }
32     public override string ToString()
33     {
34     return string.Format("{0}", this.Name);
35     }
36 william 105 }
37     }

  ViewVC Help
Powered by ViewVC 1.1.22