Example #1
0
        public static bool DoesProjectContainSubProjects(IVSSItem project)
        {
            bool result;

            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            if (!project.IsProject())
            {
                throw new ArgumentException("project");
            }

            result = false;

            foreach (IVSSItem childItem in project.Items)
            {
                if (childItem.IsProject())
                {
                    result = true;
                    break;
                }
            }

            return(result);
        }
Example #2
0
        protected virtual void AddProjectToImportList(IVSSItem projectItem, Int32 path_len_to_chop)
        {
            if (projectItem == null)
            {
                throw new ArgumentNullException("projectItem");
            }

            if (!projectItem.IsProject())
            {
                throw new ArgumentException("Not a Visual SourceSafe project");
            }

            if (!this.VssProjects.Contains(projectItem))
            {
                this.LogMessage(projectItem.Spec);
                this.VssProjects.Add(projectItem);
                string str_rel_path = VssUtilities.GetLocalPath("", projectItem, path_len_to_chop);
                this.VssRelativeProjPaths.Add(str_rel_path);
            }

            foreach (IVSSItem childItem in projectItem.Items)
            {
                if (!childItem.IsProject())
                {
                    // add the file, if it is not excluded
                    if (!this.ShouldExludeFileName(childItem.Name))
                    {
                        this.VssFiles.Add(childItem);
                        string str_rel_path = VssUtilities.GetLocalPath("", childItem, path_len_to_chop);
                        this.VssRelativeFilePaths.Add(str_rel_path);
                    }

                    // display a warning if a file is checked out
                    if (childItem.IsFileCheckedOut())
                    {
                        this.LogMessage("WARNING: '{0}' is checked out.", childItem.Spec);
                        _checkedOutFilesDetected = true;
                    }

                    // display a warning if a file is pinned
                    if (childItem.IsPinned)
                    {
                        this.LogMessage("WARNING: '{0}' is pinned.", childItem.Spec);
                        _pinned_items_detected = true;
                    }
                }

                // add child projects
                if (childItem.IsProject())
                {
                    this.AddProjectToImportList(childItem, path_len_to_chop);
                }
            }
        }