CodeArgumentCollection.cs :  » Development » devAdvantage » AnticipatingMinds » Genesis » CodeDOM » 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 » Development » devAdvantage 
devAdvantage » AnticipatingMinds » Genesis » CodeDOM » CodeArgumentCollection.cs
namespace AnticipatingMinds.Genesis.CodeDOM{
  using System;
  using System.Collections;
  using AnticipatingMinds.Genesis.CodeDOM;
    
    
  /// <summary>
  ///     <para>
  ///       A collection that stores <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> objects.
  ///    </para>
  /// </summary>
  /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/>
  [Serializable()]
  public class CodeArgumentCollection : CodeElementCollectionBase 
  {
        
    /// <summary>
    ///     <para>
    ///       Initializes a new instance of <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/>.
    ///    </para>
    /// </summary>
    public CodeArgumentCollection Clone()
        {
            CodeArgumentCollection clonedCollection = new CodeArgumentCollection();
      foreach(object collectionElement in this)
      {
        ICloneable clonable = collectionElement as ICloneable;
        if(clonable != null)
          clonedCollection.InnerList.Add(clonable.Clone());
        else
          clonedCollection.InnerList.Add(collectionElement);
      }

      return clonedCollection;
}
        public CodeArgumentCollection() 
    {
    }
        
    /// <summary>
    ///     <para>
    ///       Initializes a new instance of <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> based on another <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/>.
    ///    </para>
    /// </summary>
    /// <param name='value'>
    ///       A <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> from which the contents are copied
    /// </param>
    public CodeArgumentCollection(CodeArgumentCollection value) 
    {
      this.AddRange(value);
    }
        
    /// <summary>
    ///     <para>
    ///       Initializes a new instance of <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> containing any array of <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> objects.
    ///    </para>
    /// </summary>
    /// <param name='value'>
    ///       A array of <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> objects with which to intialize the collection
    /// </param>
    public CodeArgumentCollection(CodeArgument[] value) 
    {
      this.AddRange(value);
    }
        
    /// <summary>
    /// <para>Represents the entry at the specified index of the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/>.</para>
    /// </summary>
    /// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
    /// <value>
    ///    <para> The entry at the specified index of the collection.</para>
    /// </value>
    /// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
    public CodeArgument this[int index] 
    {
      get 
      {
        return ((CodeArgument)(List[index]));
      }
      set 
      {
        List[index] = value;
      }
    }
        
    /// <summary>
    ///    <para>Adds a <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> with the specified value to the 
    ///    <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</para>
    /// </summary>
    /// <param name='value'>The <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> to add.</param>
    /// <returns>
    ///    <para>The index at which the new element was inserted.</para>
    /// </returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.AddRange'/>
    public int Add(CodeArgument value) 
    {
      return List.Add(value);
    }
        
    /// <summary>
    /// <para>Copies the elements of an array to the end of the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/>.</para>
    /// </summary>
    /// <param name='value'>
    ///    An array of type <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> containing the objects to add to the collection.
    /// </param>
    /// <returns>
    ///   <para>None.</para>
    /// </returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.Add'/>
    public void AddRange(CodeArgument[] value) 
    {
      for (int i = 0; (i < value.Length); i = (i + 1)) 
      {
        this.Add(value[i]);
      }
    }
        
    /// <summary>
    ///     <para>
    ///       Adds the contents of another <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> to the end of the collection.
    ///    </para>
    /// </summary>
    /// <param name='value'>
    ///    A <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> containing the objects to add to the collection.
    /// </param>
    /// <returns>
    ///   <para>None.</para>
    /// </returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.Add'/>
    public void AddRange(CodeArgumentCollection value) 
    {
      for (int i = 0; (i < value.Count); i = (i + 1)) 
      {
        this.Add(value[i]);
      }
    }
        
    /// <summary>
    /// <para>Gets a value indicating whether the 
    ///    <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> contains the specified <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/>.</para>
    /// </summary>
    /// <param name='value'>The <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> to locate.</param>
    /// <returns>
    /// <para><see langword='true'/> if the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> is contained in the collection; 
    ///   otherwise, <see langword='false'/>.</para>
    /// </returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.IndexOf'/>
    public bool Contains(CodeArgument value) 
    {
      return List.Contains(value);
    }
        
    /// <summary>
    /// <para>Copies the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 
    ///    specified index.</para>
    /// </summary>
    /// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</para></param>
    /// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
    /// <returns>
    ///   <para>None.</para>
    /// </returns>
    /// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> is greater than the available space between <paramref name='arrayIndex'/> and the end of <paramref name='array'/>.</para></exception>
    /// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
    /// <exception cref='System.ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception>
    /// <seealso cref='System.Array'/>
    public void CopyTo(CodeArgument[] array, int index) 
    {
      List.CopyTo(array, index);
    }
        
    /// <summary>
    ///    <para>Returns the index of a <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> in 
    ///       the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</para>
    /// </summary>
    /// <param name='value'>The <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> to locate.</param>
    /// <returns>
    /// <para>The index of the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> of <paramref name='value'/> in the 
    /// <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/>, if found; otherwise, -1.</para>
    /// </returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.Contains'/>
    public int IndexOf(CodeArgument value) 
    {
      return List.IndexOf(value);
    }
        
    /// <summary>
    /// <para>Inserts a <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> into the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> at the specified index.</para>
    /// </summary>
    /// <param name='index'>The zero-based index where <paramref name='value'/> should be inserted.</param>
    /// <param name=' value'>The <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> to insert.</param>
    /// <returns><para>None.</para></returns>
    /// <seealso cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection.Add'/>
    public void Insert(int index, CodeArgument value) 
    {
      List.Insert(index, value);
    }
        
    /// <summary>
    ///    <para>Returns an enumerator that can iterate through 
    ///       the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</para>
    /// </summary>
    /// <returns><para>None.</para></returns>
    /// <seealso cref='System.Collections.IEnumerator'/>
    public new CodeArgumentEnumerator GetEnumerator() 
    {
      return new CodeArgumentEnumerator(this);
    }
        
    /// <summary>
    ///    <para> Removes a specific <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> from the 
    ///    <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</para>
    /// </summary>
    /// <param name='value'>The <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgument'/> to remove from the <see cref='AnticipatingMinds.Genesis.CodeDOM.CodeArgumentCollection'/> .</param>
    /// <returns><para>None.</para></returns>
    /// <exception cref='System.ArgumentException'><paramref name='value'/> is not found in the Collection. </exception>
    public void Remove(CodeArgument value) 
    {
      List.Remove(value);
    }
        /// <summary>
    /// Supports a simple iteration over a collection.
        /// </summary>
    public class CodeArgumentEnumerator : object, IEnumerator 
    {
            
      private IEnumerator baseEnumerator;
            
      private IEnumerable temp;
            
      /// <summary>
      /// Initializes a new instance of <see cref='CodeArgumentEnumerator'/>.
      /// </summary>
      /// <param name="mappings">A collection instance to iterate through.</param>
      public CodeArgumentEnumerator(CodeArgumentCollection mappings) 
      {
        this.temp = ((IEnumerable)(mappings));
        this.baseEnumerator = temp.GetEnumerator();
      }

            /// <summary>
            /// Gets the current element in the collection.
            /// </summary>
      public CodeArgument Current 
      {
        get 
        {
          return ((CodeArgument)(baseEnumerator.Current));
        }
      }
            
      /// <summary>
      /// Gets the current element in the collection.
      /// </summary>
      object IEnumerator.Current 
      {
        get 
        {
          return baseEnumerator.Current;
        }
      }
            
      /// <summary>
      /// Advances the enumerator to the next element of the collection.
      /// </summary>
      /// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
      public bool MoveNext() 
      {
        return baseEnumerator.MoveNext();
      }
            
      /// <summary>
      /// Advances the enumerator to the next element of the collection.
      /// </summary>
      /// <returns>true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.</returns>
      bool IEnumerator.MoveNext() 
      {
        return baseEnumerator.MoveNext();
      }
            
      /// <summary>
      /// Sets the enumerator to its initial position, which is before the first element in the collection.
      /// </summary>
      public void Reset() 
      {
        baseEnumerator.Reset();
      }
            
      /// <summary>
      /// Sets the enumerator to its initial position, which is before the first element in the collection.
      /// </summary>
      void IEnumerator.Reset() 
      {
        baseEnumerator.Reset();
      }
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.