NAnt.VSNet.ProjectBaseCollection.Add C# (CSharp) Method

Add() public method

Adds a ProjectBase to the end of the collection.
public Add ( ProjectBase item ) : int
item ProjectBase The to be added to the end of the collection.
return int
        public int Add(ProjectBase item)
        {
            return base.List.Add(item);
        }

Usage Example

Ejemplo n.º 1
0
        private ProjectBaseCollection GetVcProjectDependencies()
        {
            ProjectBaseCollection vcProjectDependencies = new ProjectBaseCollection();
            foreach (ProjectBase projectDependency in ProjectDependencies) {
                if (projectDependency is VcProject) {
                    vcProjectDependencies.Add(projectDependency);
                }
            }

            foreach (ReferenceBase reference in References) {
                // skip non-project reference
                ProjectReferenceBase projectReference = reference as ProjectReferenceBase;
                if (projectReference == null) {
                    continue;
                }

                // check if we're dealing with reference to VC++ project
                VcProject vcProject = projectReference.Project as VcProject;
                if (vcProject == null) {
                    continue;
                }

                // skip projects that have already been added to collection
                if (vcProjectDependencies.Contains(vcProject)) {
                    continue;
                }

                vcProjectDependencies.Add(vcProject);
            }

            return vcProjectDependencies;
        }