Atom03.cs :  » Bloggers » dasBlog » newtelligence » DasBlog » Web » Services » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Bloggers » dasBlog 
dasBlog » newtelligence » DasBlog » Web » Services » Atom03.cs
#region Copyright (c) 2003, newtelligence AG. All rights reserved.
/*
// Copyright (c) 2003, newtelligence AG. (http://www.newtelligence.com)
// Original BlogX Source Code: Copyright (c) 2003, Chris Anderson (http://simplegeek.com)
// All rights reserved.
//  
// Redistribution and use in source and binary forms, with or without modification, are permitted 
// provided that the following conditions are met: 
//  
// (1) Redistributions of source code must retain the above copyright notice, this list of 
// conditions and the following disclaimer. 
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of 
// conditions and the following disclaimer in the documentation and/or other materials 
// provided with the distribution. 
// (3) Neither the name of the newtelligence AG nor the names of its contributors may be used 
// to endorse or promote products derived from this software without specific prior 
// written permission.
//      
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// -------------------------------------------------------------------------
//
// Original BlogX source code (c) 2003 by Chris Anderson (http://simplegeek.com)
// 
// newtelligence is a registered trademark of newtelligence Aktiengesellschaft.
// 
// For portions of this software, the some additional copyright notices may apply 
// which can either be found in the license.txt file included in the source distribution
// or following this notice. 
//
*/
#endregion

using System;
using System.Xml;
using System.Xml.Serialization;

namespace newtelligence.DasBlog.Web.Services.Atom03{
  [XmlRoot("feed", Namespace="http://purl.org/atom/ns#")]
  public class AtomRoot
  {
    public AtomRoot()
    {
      Namespaces = new XmlSerializerNamespaces();
      Version = "0.3";
      entries = new AtomEntryCollection();
      contributors = new AtomParticipantCollection();
    }

    [XmlNamespaceDeclarations] 
    public XmlSerializerNamespaces Namespaces;

    string version;
    [XmlAttribute("version")]
    public string Version { get { return version; } set { version = value; } }

    string lang;
    [XmlAttribute("lang", Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="http://www.w3.org/XML/1998/namespace")]
    public string Lang { get { return lang; } set { lang = value; } }
    
    string title;
    [XmlElement("title")]
    public string Title { get { return title; } set { title = value; } }

    AtomLink link;
    [XmlElement("link")]
    public AtomLink Link { get { return link; } set { link = value; } }

    DateTime modified;
    [XmlIgnore]
    public DateTime ModifiedUtc { get { return modified; } set { modified = value; } }
        [XmlElement("modified")]
        public DateTime ModifiedLocalTime { get { return (ModifiedUtc==DateTime.MinValue||ModifiedUtc==DateTime.MaxValue)?ModifiedUtc:ModifiedUtc.ToLocalTime(); } set { ModifiedUtc = (value==DateTime.MinValue||value==DateTime.MaxValue)?value:value.ToUniversalTime(); } }

    string tagline;
    [XmlElement("tagline")]
    public string Tagline { get { return tagline; } set { tagline = value; } }

    string id;
    [XmlElement("id")]
    public string Id { get { return id; } set { id = value; } }

    AtomGenerator generator;
    [XmlElement("generator")]
    public AtomGenerator Generator { get { return generator; } set { generator = value; } }

    string copyright;
    [XmlElement("copyright")]
    public string Copyright { get { return copyright; } set { copyright = value; } }

    AtomParticipant author;
    [XmlElement("author")]
    public AtomParticipant Author { get { return author; } set { author = value; } }

    AtomParticipantCollection contributors;
    [XmlElement("contributor")]
    public AtomParticipantCollection Contributors { get { return contributors; } set { contributors = value; } }

    AtomEntryCollection entries;
    [XmlElement("entry")]
    public AtomEntryCollection Entries { get { return entries; } set { entries = value; } }

        [XmlAnyElement]
        public XmlElement[] anyElements;
        [XmlAnyAttribute]
        public XmlAttribute[] anyAttributes;
  }

  [XmlRoot("entry")]
  public class AtomLink
  {
    string rel;
    [XmlAttribute("rel")]
    public string Rel { get { return rel; } set { rel = value; } }
    
    string type;
    [XmlAttribute("type")]
    public string Type { get { return type; } set { type = value; } }

    string href;
    [XmlAttribute("href")]
    public string Href { get { return href; } set { href = value; } }

    [XmlAnyElement]
    public XmlElement[] anyElements;
    [XmlAnyAttribute]
    public XmlAttribute[] anyAttributes;

    public AtomLink()
    {
    }

    public AtomLink(string href)
    {
      this.Rel = "alternate";
      this.Type = "text/html";
      this.Href = href;
    }
  }

  [XmlRoot("entry")]
  public class AtomGenerator
  {
    string url;
    [XmlText]
    public string Url { get { return url; } set { url = value; } }
    
//    string name;
//    [XmlAttribute("name")]
//    public string Name { get { return name; } set { name = value; } }

        [XmlAnyElement]
        public XmlElement[] anyElements;
        [XmlAnyAttribute]
        public XmlAttribute[] anyAttributes;
  }

  [XmlRoot("entry")]
  public class AtomEntry
  {
    public AtomEntry() {}

    public AtomEntry(string title, AtomLink link, string id, DateTime issued, DateTime modified)
    {
      this.Title = title;
      this.Link = link;
      this.Id = id;
      this.IssuedUtc = issued;
      this.ModifiedUtc = modified;
    }

    string title;
    [XmlElement("title")]
    public string Title { get { return title; } set { title = value; } }

    AtomLink link;
    [XmlElement("link")]
    public AtomLink Link { get { return link; } set { link = value; } }

    string id;
    [XmlElement("id")]
    public string Id { get { return id; } set { id = value; } }

    DateTime issued;
    [XmlIgnore]
    public DateTime IssuedUtc { get { return issued; } set { issued = value; } }
        [XmlElement("issued")]
        public DateTime IssuedLocalTime { get { return (IssuedUtc==DateTime.MinValue||IssuedUtc==DateTime.MaxValue)?IssuedUtc:IssuedUtc.ToLocalTime(); } set { IssuedUtc = (value==DateTime.MinValue||value==DateTime.MaxValue)?value:value.ToUniversalTime(); } }

    DateTime modified;
    [XmlIgnore]
    public DateTime ModifiedUtc { get { return modified; } set { modified = value; } }
        [XmlElement("modified")]
        public DateTime ModifiedLocalTime { get { return (ModifiedUtc==DateTime.MinValue||ModifiedUtc==DateTime.MaxValue)?ModifiedUtc:ModifiedUtc.ToLocalTime(); } set { ModifiedUtc = (value==DateTime.MinValue||value==DateTime.MaxValue)?value:value.ToUniversalTime(); } }

    DateTime created;
    [XmlIgnore]
    public DateTime Created 
    { 
      get 
            { 
                return created; 
            } 
      set 
      { 
        created = value;
        CreatedLocalTimeSpecified = true;
      } 
    }
        [XmlElement("created")]
        public DateTime CreatedLocalTime { get { return (Created==DateTime.MinValue||Created==DateTime.MaxValue)?Created:Created.ToLocalTime(); } set { Created = (value==DateTime.MinValue||value==DateTime.MaxValue)?value:value.ToUniversalTime(); } }

    [XmlIgnore]
    public bool CreatedLocalTimeSpecified;

    string summary;
    [XmlElement("summary")]
    public string Summary { get { return summary; } set { summary = value; } }

    AtomParticipant author;
    [XmlElement("author")]
    public AtomParticipant Author { get { return author; } set { author = value; } }

    AtomContent content;
    [XmlElement("content")]
    public AtomContent Content { get { return content; } set { content = value; } }

        [XmlAnyElement]
        public XmlElement[] anyElements;
        [XmlAnyAttribute]
        public XmlAttribute[] anyAttributes;
  }

  public class AtomParticipant
  {
    string name;
    [XmlElement("name")]
    public string Name { get { return name; } set { name = value; } }

    string url;
    [XmlElement("url")]
    public string Url { get { return url; } set { url = value; } }

    string email;
    [XmlElement("email")]
    public string EMail { get { return email; } set { email = value; } }

        [XmlAnyElement]
        public XmlElement[] anyElements;
        [XmlAnyAttribute]
        public XmlAttribute[] anyAttributes;
  }

  [XmlRoot("content")]
  public class AtomContent
  {
    string type;
    [XmlAttribute("type")]
    public string Type { get { return type; } set { type = value; } }

    AtomContentMode mode;
    [XmlAttribute("mode")]
    public AtomContentMode Mode 
    { 
      get { return mode; } 
      set 
      { 
        mode = value;
        ModeSpecified = true;
      } 
    }

    [XmlIgnore]
    public bool ModeSpecified;

    string lang;
    [XmlAttribute("lang", Form=System.Xml.Schema.XmlSchemaForm.Qualified, Namespace="http://www.w3.org/XML/1998/namespace")]
    public string Lang { get { return lang; } set { lang = value; } }


        [XmlAnyElement]
        public XmlElement[] anyElements;
        [XmlAnyAttribute]
        public XmlAttribute[] anyAttributes;
  }

  public enum AtomContentMode 
  {
    [XmlEnum(Name = "xml")]
    Xml,
    [XmlEnum(Name = "escaped")]
    Escaped,
    [XmlEnum(Name = "base64")]
    Base64,
  }

  /// <summary>
  /// A collection of elements of type AtomEntry
  /// </summary>
  public class AtomEntryCollection: System.Collections.CollectionBase
  {
    /// <summary>
    /// Initializes a new empty instance of the AtomEntryCollection class.
    /// </summary>
    public AtomEntryCollection()
    {
      // empty
    }

    /// <summary>
    /// Initializes a new instance of the AtomEntryCollection class, containing elements
    /// copied from an array.
    /// </summary>
    /// <param name="entries">
    /// The array whose elements are to be added to the new AtomEntryCollection.
    /// </param>
    public AtomEntryCollection(AtomEntry[] entries)
    {
      this.AddRange(entries);
    }

    /// <summary>
    /// Initializes a new instance of the AtomEntryCollection class, containing elements
    /// copied from another instance of AtomEntryCollection
    /// </summary>
    /// <param name="entries">
    /// The AtomEntryCollection whose elements are to be added to the new AtomEntryCollection.
    /// </param>
    public AtomEntryCollection(AtomEntryCollection entries)
    {
      this.AddRange(entries);
    }

    /// <summary>
    /// Adds the elements of an array to the end of this AtomEntryCollection.
    /// </summary>
    /// <param name="entries">
    /// The array whose elements are to be added to the end of this AtomEntryCollection.
    /// </param>
    public virtual void AddRange(AtomEntry[] entries)
    {
      foreach (AtomEntry entry in entries)
      {
        this.List.Add(entry);
      }
    }

    /// <summary>
    /// Adds the elements of another AtomEntryCollection to the end of this AtomEntryCollection.
    /// </summary>
    /// <param name="entries">
    /// The AtomEntryCollection whose elements are to be added to the end of this AtomEntryCollection.
    /// </param>
    public virtual void AddRange(AtomEntryCollection entries)
    {
      foreach (AtomEntry entry in entries)
      {
        this.List.Add(entry);
      }
    }

    /// <summary>
    /// Adds an instance of type AtomEntry to the end of this AtomEntryCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomEntry to be added to the end of this AtomEntryCollection.
    /// </param>
    public virtual void Add(AtomEntry value)
    {
      this.List.Add(value);
    }

    /// <summary>
    /// Determines whether a specfic AtomEntry value is in this AtomEntryCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomEntry value to locate in this AtomEntryCollection.
    /// </param>
    /// <returns>
    /// true if value is found in this AtomEntryCollection;
    /// false otherwise.
    /// </returns>
    public virtual bool Contains(AtomEntry value)
    {
      return this.List.Contains(value);
    }

    /// <summary>
    /// Return the zero-based index of the first occurrence of a specific value
    /// in this AtomEntryCollection
    /// </summary>
    /// <param name="value">
    /// The AtomEntry value to locate in the AtomEntryCollection.
    /// </param>
    /// <returns>
    /// The zero-based index of the first occurrence of the _ELEMENT value if found;
    /// -1 otherwise.
    /// </returns>
    public virtual int IndexOf(AtomEntry value)
    {
      return this.List.IndexOf(value);
    }

    /// <summary>
    /// Inserts an element into the AtomEntryCollection at the specified index
    /// </summary>
    /// <param name="index">
    /// The index at which the AtomEntry is to be inserted.
    /// </param>
    /// <param name="value">
    /// The AtomEntry to insert.
    /// </param>
    public virtual void Insert(int index, AtomEntry value)
    {
      this.List.Insert(index, value);
    }

    /// <summary>
    /// Gets or sets the AtomEntry at the given index in this AtomEntryCollection.
    /// </summary>
    public virtual AtomEntry this[int index]
    {
      get
      {
        return (AtomEntry) this.List[index];
      }
      set
      {
        this.List[index] = value;
      }
    }

    /// <summary>
    /// Removes the first occurrence of a specific AtomEntry from this AtomEntryCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomEntry value to remove from this AtomEntryCollection.
    /// </param>
    public virtual void Remove(AtomEntry value)
    {
      this.List.Remove(value);
    }

    /// <summary>
    /// Type-specific enumeration class, used by AtomEntryCollection.GetEnumerator.
    /// </summary>
    public class Enumerator: System.Collections.IEnumerator
    {
      private System.Collections.IEnumerator wrapped;

      public Enumerator(AtomEntryCollection collection)
      {
        this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
      }

      public AtomEntry Current
      {
        get
        {
          return (AtomEntry) (this.wrapped.Current);
        }
      }

      object System.Collections.IEnumerator.Current
      {
        get
        {
          return (AtomEntry) (this.wrapped.Current);
        }
      }

      public bool MoveNext()
      {
        return this.wrapped.MoveNext();
      }

      public void Reset()
      {
        this.wrapped.Reset();
      }
    }

    /// <summary>
    /// Returns an enumerator that can iterate through the elements of this AtomEntryCollection.
    /// </summary>
    /// <returns>
    /// An object that implements System.Collections.IEnumerator.
    /// </returns>        
    public new virtual AtomEntryCollection.Enumerator GetEnumerator()
    {
      return new AtomEntryCollection.Enumerator(this);
    }
  }


  /// <summary>
  /// A collection of elements of type AtomParticipant
  /// </summary>
  public class AtomParticipantCollection: System.Collections.CollectionBase
  {
    /// <summary>
    /// Initializes a new empty instance of the AtomParticipantCollection class.
    /// </summary>
    public AtomParticipantCollection()
    {
      // empty
    }

    /// <summary>
    /// Initializes a new instance of the AtomParticipantCollection class, containing elements
    /// copied from an array.
    /// </summary>
    /// <param name="participants">
    /// The array whose elements are to be added to the new AtomParticipantCollection.
    /// </param>
    public AtomParticipantCollection(AtomParticipant[] participants)
    {
      this.AddRange(participants);
    }

    /// <summary>
    /// Initializes a new instance of the AtomParticipantCollection class, containing elements
    /// copied from another instance of AtomParticipantCollection
    /// </summary>
    /// <param name="participants">
    /// The AtomParticipantCollection whose elements are to be added to the new AtomParticipantCollection.
    /// </param>
    public AtomParticipantCollection(AtomParticipantCollection participants)
    {
      this.AddRange(participants);
    }

    /// <summary>
    /// Adds the elements of an array to the end of this AtomParticipantCollection.
    /// </summary>
    /// <param name="participants">
    /// The array whose elements are to be added to the end of this AtomParticipantCollection.
    /// </param>
    public virtual void AddRange(AtomParticipant[] participants)
    {
      foreach (AtomParticipant participant in participants)
      {
        this.List.Add(participant);
      }
    }

    /// <summary>
    /// Adds the elements of another AtomParticipantCollection to the end of this AtomParticipantCollection.
    /// </summary>
    /// <param name="participants">
    /// The AtomParticipantCollection whose elements are to be added to the end of this AtomParticipantCollection.
    /// </param>
    public virtual void AddRange(AtomParticipantCollection participants)
    {
      foreach (AtomParticipant participant in participants)
      {
        this.List.Add(participant);
      }
    }

    /// <summary>
    /// Adds an instance of type AtomParticipant to the end of this AtomParticipantCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomParticipant to be added to the end of this AtomParticipantCollection.
    /// </param>
    public virtual void Add(AtomParticipant value)
    {
      this.List.Add(value);
    }

    /// <summary>
    /// Determines whether a specfic AtomParticipant value is in this AtomParticipantCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomParticipant value to locate in this AtomParticipantCollection.
    /// </param>
    /// <returns>
    /// true if value is found in this AtomParticipantCollection;
    /// false otherwise.
    /// </returns>
    public virtual bool Contains(AtomParticipant value)
    {
      return this.List.Contains(value);
    }

    /// <summary>
    /// Return the zero-based index of the first occurrence of a specific value
    /// in this AtomParticipantCollection
    /// </summary>
    /// <param name="value">
    /// The AtomParticipant value to locate in the AtomParticipantCollection.
    /// </param>
    /// <returns>
    /// The zero-based index of the first occurrence of the _ELEMENT value if found;
    /// -1 otherwise.
    /// </returns>
    public virtual int IndexOf(AtomParticipant value)
    {
      return this.List.IndexOf(value);
    }

    /// <summary>
    /// Inserts an element into the AtomParticipantCollection at the specified index
    /// </summary>
    /// <param name="index">
    /// The index at which the AtomParticipant is to be inserted.
    /// </param>
    /// <param name="value">
    /// The AtomParticipant to insert.
    /// </param>
    public virtual void Insert(int index, AtomParticipant value)
    {
      this.List.Insert(index, value);
    }

    /// <summary>
    /// Gets or sets the AtomParticipant at the given index in this AtomParticipantCollection.
    /// </summary>
    public virtual AtomParticipant this[int index]
    {
      get
      {
        return (AtomParticipant) this.List[index];
      }
      set
      {
        this.List[index] = value;
      }
    }

    /// <summary>
    /// Removes the first occurrence of a specific AtomParticipant from this AtomParticipantCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomParticipant value to remove from this AtomParticipantCollection.
    /// </param>
    public virtual void Remove(AtomParticipant value)
    {
      this.List.Remove(value);
    }

    /// <summary>
    /// Type-specific enumeration class, used by AtomParticipantCollection.GetEnumerator.
    /// </summary>
    public class Enumerator: System.Collections.IEnumerator
    {
      private System.Collections.IEnumerator wrapped;

      public Enumerator(AtomParticipantCollection collection)
      {
        this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
      }

      public AtomParticipant Current
      {
        get
        {
          return (AtomParticipant) (this.wrapped.Current);
        }
      }

      object System.Collections.IEnumerator.Current
      {
        get
        {
          return (AtomParticipant) (this.wrapped.Current);
        }
      }

      public bool MoveNext()
      {
        return this.wrapped.MoveNext();
      }

      public void Reset()
      {
        this.wrapped.Reset();
      }
    }

    /// <summary>
    /// Returns an enumerator that can iterate through the elements of this AtomParticipantCollection.
    /// </summary>
    /// <returns>
    /// An object that implements System.Collections.IEnumerator.
    /// </returns>        
    public new virtual AtomParticipantCollection.Enumerator GetEnumerator()
    {
      return new AtomParticipantCollection.Enumerator(this);
    }
  }


  /// <summary>
  /// A collection of elements of type AtomContent
  /// </summary>
  public class AtomContentCollection: System.Collections.CollectionBase
  {
    /// <summary>
    /// Initializes a new empty instance of the AtomContentCollection class.
    /// </summary>
    public AtomContentCollection()
    {
      // empty
    }

    /// <summary>
    /// Initializes a new instance of the AtomContentCollection class, containing elements
    /// copied from an array.
    /// </summary>
    /// <param name="content">
    /// The array whose elements are to be added to the new AtomContentCollection.
    /// </param>
    public AtomContentCollection(AtomContent[] content)
    {
      this.AddRange(content);
    }

    /// <summary>
    /// Initializes a new instance of the AtomContentCollection class, containing elements
    /// copied from another instance of AtomContentCollection
    /// </summary>
    /// <param name="content">
    /// The AtomContentCollection whose elements are to be added to the new AtomContentCollection.
    /// </param>
    public AtomContentCollection(AtomContentCollection content)
    {
      this.AddRange(content);
    }

    /// <summary>
    /// Adds the elements of an array to the end of this AtomContentCollection.
    /// </summary>
    /// <param name="content">
    /// The array whose elements are to be added to the end of this AtomContentCollection.
    /// </param>
    public virtual void AddRange(AtomContent[] content)
    {
      foreach (AtomContent contentEntry in content)
      {
        this.List.Add(contentEntry);
      }
    }

    /// <summary>
    /// Adds the elements of another AtomContentCollection to the end of this AtomContentCollection.
    /// </summary>
    /// <param name="content">
    /// The AtomContentCollection whose elements are to be added to the end of this AtomContentCollection.
    /// </param>
    public virtual void AddRange(AtomContentCollection content)
    {
      foreach (AtomContent contentEntry in content)
      {
        this.List.Add(contentEntry);
      }
    }

    /// <summary>
    /// Adds an instance of type AtomContent to the end of this AtomContentCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomContent to be added to the end of this AtomContentCollection.
    /// </param>
    public virtual void Add(AtomContent value)
    {
      this.List.Add(value);
    }

    /// <summary>
    /// Determines whether a specfic AtomContent value is in this AtomContentCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomContent value to locate in this AtomContentCollection.
    /// </param>
    /// <returns>
    /// true if value is found in this AtomContentCollection;
    /// false otherwise.
    /// </returns>
    public virtual bool Contains(AtomContent value)
    {
      return this.List.Contains(value);
    }

    /// <summary>
    /// Return the zero-based index of the first occurrence of a specific value
    /// in this AtomContentCollection
    /// </summary>
    /// <param name="value">
    /// The AtomContent value to locate in the AtomContentCollection.
    /// </param>
    /// <returns>
    /// The zero-based index of the first occurrence of the _ELEMENT value if found;
    /// -1 otherwise.
    /// </returns>
    public virtual int IndexOf(AtomContent value)
    {
      return this.List.IndexOf(value);
    }

    /// <summary>
    /// Inserts an element into the AtomContentCollection at the specified index
    /// </summary>
    /// <param name="index">
    /// The index at which the AtomContent is to be inserted.
    /// </param>
    /// <param name="value">
    /// The AtomContent to insert.
    /// </param>
    public virtual void Insert(int index, AtomContent value)
    {
      this.List.Insert(index, value);
    }

    /// <summary>
    /// Gets or sets the AtomContent at the given index in this AtomContentCollection.
    /// </summary>
    public virtual AtomContent this[int index]
    {
      get
      {
        return (AtomContent) this.List[index];
      }
      set
      {
        this.List[index] = value;
      }
    }

    /// <summary>
    /// Removes the first occurrence of a specific AtomContent from this AtomContentCollection.
    /// </summary>
    /// <param name="value">
    /// The AtomContent value to remove from this AtomContentCollection.
    /// </param>
    public virtual void Remove(AtomContent value)
    {
      this.List.Remove(value);
    }

    /// <summary>
    /// Type-specific enumeration class, used by AtomContentCollection.GetEnumerator.
    /// </summary>
    public class Enumerator: System.Collections.IEnumerator
    {
      private System.Collections.IEnumerator wrapped;

      public Enumerator(AtomContentCollection collection)
      {
        this.wrapped = ((System.Collections.CollectionBase)collection).GetEnumerator();
      }

      public AtomContent Current
      {
        get
        {
          return (AtomContent) (this.wrapped.Current);
        }
      }

      object System.Collections.IEnumerator.Current
      {
        get
        {
          return (AtomContent) (this.wrapped.Current);
        }
      }

      public bool MoveNext()
      {
        return this.wrapped.MoveNext();
      }

      public void Reset()
      {
        this.wrapped.Reset();
      }
    }

    /// <summary>
    /// Returns an enumerator that can iterate through the elements of this AtomContentCollection.
    /// </summary>
    /// <returns>
    /// An object that implements System.Collections.IEnumerator.
    /// </returns>        
    public new virtual AtomContentCollection.Enumerator GetEnumerator()
    {
      return new AtomContentCollection.Enumerator(this);
    }
  }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.