NAnt.VSNet.ProjectBaseCollection.Contains C# (CSharp) Метод

Contains() публичный Метод

Determines whether a ProjectBase is in the collection.
public Contains ( ProjectBase item ) : bool
item ProjectBase The to locate in the collection.
Результат bool
        public bool Contains(ProjectBase item)
        {
            return base.List.Contains(item);
        }

Same methods

ProjectBaseCollection::Contains ( string value ) : bool

Usage Example

Пример #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;
        }