Inheritance: DataTypeCollectionBase, IList
 /// <summary>
 /// Adds the items of a <see cref="NamespaceImportCollection"/> to the end of the collection.
 /// </summary>
 /// <param name="items">The <see cref="NamespaceImportCollection"/> to be added to the end of the collection.</param>
 public void AddRange(NamespaceImportCollection items)
 {
     for (int i = 0; (i < items.Count); i = (i + 1))
     {
         Add(items[i]);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VBProject"/> class.
        /// </summary>
        /// <param name="solution">The solution.</param>
        /// <param name="projectPath">The project path.</param>
        /// <param name="xmlDefinition">The XML definition.</param>
        /// <param name="solutionTask">The solution task.</param>
        /// <param name="tfc">The TFC.</param>
        /// <param name="gacCache">The gac cache.</param>
        /// <param name="refResolver">The reference resolver.</param>
        /// <param name="outputDir">The output dir.</param>
        public VBProject(SolutionBase solution, string projectPath, XmlElement xmlDefinition, SolutionTask solutionTask, TempFileCollection tfc, GacCache gacCache, ReferencesResolver refResolver, DirectoryInfo outputDir)
            : base(solution, projectPath, xmlDefinition, solutionTask, tfc, gacCache, refResolver, outputDir)
        {
            _imports = new NamespaceImportCollection();

            // process namespace imports
            XmlNodeList imports = xmlDefinition.SelectNodes("//Imports/Import");
            foreach (XmlElement import in imports) {
                XmlAttribute nsAttribute = import.Attributes["Namespace"];
                if (nsAttribute != null) {
                    string nameSpace = nsAttribute.Value.ToString(
                        CultureInfo.InvariantCulture);
                    _imports.Add(new NamespaceImport(nameSpace));
                }
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NamespaceImportEnumerator"/> class
        /// with the specified <see cref="NamespaceImportCollection"/>.
        /// </summary>
        /// <param name="arguments">The collection that should be enumerated.</param>
        internal NamespaceImportEnumerator(NamespaceImportCollection arguments)
        {
            IEnumerable temp = (IEnumerable)(arguments);

            _baseEnumerator = temp.GetEnumerator();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NamespaceImportEnumerator"/> class
 /// with the specified <see cref="NamespaceImportCollection"/>.
 /// </summary>
 /// <param name="arguments">The collection that should be enumerated.</param>
 internal NamespaceImportEnumerator(NamespaceImportCollection arguments)
 {
     IEnumerable temp = (IEnumerable) (arguments);
     _baseEnumerator = temp.GetEnumerator();
 }
 /// <summary>
 /// Adds the items of a <see cref="NamespaceImportCollection"/> to the end of the collection.
 /// </summary>
 /// <param name="items">The <see cref="NamespaceImportCollection"/> to be added to the end of the collection.</param> 
 public void AddRange(NamespaceImportCollection items)
 {
     for (int i = 0; (i < items.Count); i = (i + 1)) {
         Add(items[i]);
     }
 }