Example #1
0
        private void LoadProjectDetails(Project p)
        {
            lvProjectDetails.Items.Clear();
            if (p == null) {
                return;
            }

            int i = 0;
            foreach (Dependency d in p.Dependencies.Values) {
                ListViewItem lvi = new ListViewItem();
                lvi.Content = d.DependencyName;
                lvi.Tag = d;
                lvProjectDetails.Items.Add(lvi);
                if (i == 0) {
                    lvi.IsSelected = true;
                }
                i++;
            }
        }
Example #2
0
        public void Load(string rootPath, string fileFilter)
        {
            string[] fileFilters;
            if (string.IsNullOrEmpty(fileFilter)) {
                fileFilter = "*.*";
            }
            fileFilters = fileFilter.Split(new char[] {'|'});

            List<string> projectFiles = new List<string>();
            foreach (string filter in fileFilters) {
                projectFiles.AddRange(Directory.GetFiles(rootPath, filter, SearchOption.AllDirectories));
            }

            _projects = new List<Project>();
            foreach (string projectFile in projectFiles) {
                Project p = new Project();
                p.Load(projectFile);
                _projects.Add(p);
            }
        }
Example #3
0
        private bool IsProjectDependent(Project p, string projectName)
        {
            if (p.Dependencies.ContainsKey(projectName)) {
                return true;
            }

            foreach (Dependency d in p.Dependencies.Values) {
                if (string.IsNullOrEmpty(d.DependencyFileName)) {
                    continue;
                }

                foreach (Project p1 in _projects) {
                    string tmpProjectName = Path.GetFileNameWithoutExtension(p1.ProjectFileName);
                    if (d.DependencyName == tmpProjectName) {
                        if (IsProjectDependent(p1, projectName)) {
                            return true;
                        }
                    }
                }
            }

            return false;
        }