コード例 #1
0
 /// <summary>
 /// Adds a <see cref="EnvironmentVariable"/> to the end of the collection.
 /// </summary>
 /// <param name="item">The <see cref="EnvironmentVariable"/> to be added to the end of the collection.</param> 
 /// <returns>The position into which the new element was inserted.</returns>
 public int Add(EnvironmentVariable item) {
     return base.List.Add(item);
 }
コード例 #2
0
        /// <summary>
        /// Processes the framework environment variables.
        /// </summary>
        /// <param name="environmentNodes">An <see cref="XmlNodeList" /> representing framework environment variables.</param>
        /// <param name="framework">The <see cref="FrameworkInfo" /> to obtain framework-specific information from.</param>
        private EnvironmentVariableCollection ProcessFrameworkEnvironmentVariables(XmlNodeList environmentNodes, FrameworkInfo framework)
        {
            EnvironmentVariableCollection frameworkEnvironment = null;

            // initialize framework-specific environment variables
            frameworkEnvironment = new EnvironmentVariableCollection();

            foreach (XmlNode environmentNode in environmentNodes) {
                // skip non-nant namespace elements and special elements like comments, pis, text, etc.
                if (!(environmentNode.NodeType == XmlNodeType.Element)) {
                    continue;
                }

                // initialize element
                EnvironmentVariable environmentVariable = new EnvironmentVariable();
                environmentVariable.Parent = environmentVariable.Project = framework.Project;
                environmentVariable.NamespaceManager = NamespaceManager;

                // configure using xml node
                environmentVariable.Initialize(environmentNode, framework.Project.Properties,
                    framework);

                // add to collection of environment variables
                frameworkEnvironment.Add(environmentVariable);
            }

            return frameworkEnvironment;
        }
コード例 #3
0
 /// <summary>
 /// Removes a member from the collection.
 /// </summary>
 /// <param name="item">The <see cref="EnvironmentVariable"/> to remove from the collection.</param>
 public void Remove(EnvironmentVariable item) {
     base.List.Remove(item);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnvironmentVariableCollection"/> class
 /// with the specified array of <see cref="EnvironmentVariable"/> instances.
 /// </summary>
 public EnvironmentVariableCollection(EnvironmentVariable[] value) {
     AddRange(value);
 }
コード例 #5
0
 /// <summary>
 /// Inserts a <see cref="EnvironmentVariable"/> into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The <see cref="EnvironmentVariable"/> to insert.</param>
 public void Insert(int index, EnvironmentVariable item) {
     base.List.Insert(index, item);
 }
コード例 #6
0
 /// <summary>
 /// Retrieves the index of a specified <see cref="EnvironmentVariable"/> object in the collection.
 /// </summary>
 /// <param name="item">The <see cref="EnvironmentVariable"/> object for which the index is returned.</param> 
 /// <returns>
 /// The index of the specified <see cref="EnvironmentVariable"/>. If the <see cref="EnvironmentVariable"/> is not currently a member of the collection, it returns -1.
 /// </returns>
 public int IndexOf(EnvironmentVariable item) {
     return base.List.IndexOf(item);
 }
コード例 #7
0
 /// <summary>
 /// Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        
 /// </summary>
 /// <param name="array">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> 
 /// <param name="index">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 public void CopyTo(EnvironmentVariable[] array, int index) {
     base.List.CopyTo(array, index);
 }
コード例 #8
0
 /// <summary>
 /// Determines whether a <see cref="EnvironmentVariable"/> is in the collection.
 /// </summary>
 /// <param name="item">The <see cref="EnvironmentVariable"/> to locate in the collection.</param> 
 /// <returns>
 /// <see langword="true" /> if <paramref name="item"/> is found in the 
 /// collection; otherwise, <see langword="false" />.
 /// </returns>
 public bool Contains(EnvironmentVariable item) {
     return base.List.Contains(item);
 }
コード例 #9
0
 /// <summary>
 /// Adds the elements of a <see cref="EnvironmentVariable"/> array to the end of the collection.
 /// </summary>
 /// <param name="items">The array of <see cref="EnvironmentVariable"/> elements to be added to the end of the collection.</param> 
 public void AddRange(EnvironmentVariable[] items) {
     for (int i = 0; (i < items.Length); i = (i + 1)) {
         Add(items[i]);
     }
 }