void OnEntryRemoved(object sender, SolutionItemEventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem);

            if (tb != null)
            {
                tb.Remove();
            }
        }
Exemplo n.º 2
0
        static void OnEntryAdded(object o, SolutionItemEventArgs args)
        {
            if (args is SolutionItemChangeEventArgs && ((SolutionItemChangeEventArgs)args).Reloading)
            {
                return;
            }

            // handles addition of solutions and projects
            SolutionItem parent = (SolutionItem)args.SolutionItem.ParentFolder;

            if (parent == null)
            {
                return;
            }

            Repository repo = GetRepository(parent);

            if (repo == null)
            {
                return;
            }

            SolutionItem entry       = args.SolutionItem;
            Repository   currentRepo = GetRepository(entry);

            if (currentRepo != null && currentRepo.VersionControlSystem != repo.VersionControlSystem)
            {
                // If the item is already under version control using a different version control system
                // don't add it to the parent repo.
                return;
            }

            string path = entry.BaseDirectory;

            // While we /could/ call repo.Add with `recursive = true', we don't
            // necessarily want to add files under the project/solution directory
            // that may not be a part of this project/solution.

            var files = new HashSet <string> {
                path
            };

            SolutionItemAddFiles(path, entry, files);

            using (IProgressMonitor monitor = GetStatusMonitor()) {
                var status = repo.GetDirectoryVersionInfo(path, false, true);
                foreach (var v in status)
                {
                    if (!v.IsVersioned && files.Contains(v.LocalPath))
                    {
                        repo.Add(v.LocalPath, false, monitor);
                    }
                }
            }

            NotifyFileStatusChanged(new FileUpdateEventArgs(repo, parent.BaseDirectory, true));
        }
Exemplo n.º 3
0
        void OnSolutionItemAddedRemoved(object sender, SolutionItemEventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(e.Solution);

            if (tb != null)
            {
                tb.Update();                    // Update the entry count
            }
        }
Exemplo n.º 4
0
        void OnEntryAdded(object sender, SolutionItemEventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem.ParentFolder);

            if (tb != null)
            {
                tb.AddChild(e.SolutionItem, true);
                tb.Expanded = true;
            }
        }
        static void OnEntryAdded(object o, SolutionItemEventArgs args)
        {
            // handles addition of solutions and projects
            SolutionItem parent = (SolutionItem)args.SolutionItem.ParentFolder;

            if (parent == null)
            {
                return;
            }

            Repository repo = GetRepository(parent);

            if (repo == null)
            {
                return;
            }

            SolutionItem entry       = args.SolutionItem;
            Repository   currentRepo = GetRepository(entry);

            if (currentRepo != null && currentRepo.VersionControlSystem != repo.VersionControlSystem)
            {
                // If the item is already under version control using a different version control system
                // don't add it to the parent repo.
                return;
            }

            string path = entry.BaseDirectory;

            // While we /could/ call repo.Add with `recursive = true', we don't
            // necessarily want to add files under the project/solution directory
            // that may not be a part of this project/solution.

            ArrayList files = new ArrayList();

            files.Add(path);
            SolutionItemAddFiles(path, entry, files);
            files.Sort();

            using (IProgressMonitor monitor = GetStatusMonitor())
            {
                string[] paths = (string[])files.ToArray(typeof(string));

                foreach (string p in paths)
                {
                    if (repo.GetVersionInfo(p).CanAdd)
                    {
                        repo.Add(p, false, monitor);
                    }
                }
            }

            NotifyFileStatusChanged(new FileUpdateEventArgs(repo, parent.BaseDirectory, true));
        }
Exemplo n.º 6
0
        private static void OnEntryAddedToCombine(object sender, SolutionItemEventArgs e)
        {
            CProject p = e.SolutionItem as CProject;

            if (p == null)
            {
                return;
            }

            foreach (ProjectFile f in p.Files)
            {
                TagDatabaseManager.Instance.UpdateFileTags(p, f.Name);
            }
        }
Exemplo n.º 7
0
        protected override void OnSaved(SolutionItemEventArgs args)
        {
            base.OnSaved(args);

            if (ExtendedConfiguration != null)
            {
                try
                {
                    var json = JsonConvert.SerializeObject(ExtendedConfiguration, Newtonsoft.Json.Formatting.Indented);
                    File.WriteAllText(BaseDirectory.Combine(ConfigJson), json);
                }
                catch
                {
                }
            }
        }
        static void OnEntryAdded(object o, SolutionItemEventArgs args)
        {
            // handles addition of solutions and projects
            SolutionItem parent = (SolutionItem)args.SolutionItem.ParentFolder;

            if (parent == null)
            {
                return;
            }

            Repository repo = GetRepository(parent);

            if (repo == null)
            {
                return;
            }

            SolutionItem entry = args.SolutionItem;
            string       path  = entry.BaseDirectory;

            if (!repo.CanAdd(path))
            {
                return;
            }

            // While we /could/ call repo.Add with `recursive = true', we don't
            // necessarily want to add files under the project/solution directory
            // that may not be a part of this project/solution.

            ArrayList files = new ArrayList();

            files.Add(path);
            SolutionItemAddFiles(path, entry, files);
            files.Sort();

            using (IProgressMonitor monitor = GetStatusMonitor()) {
                string[] paths = (string[])files.ToArray(typeof(string));

                for (int i = 0; i < paths.Length; i++)
                {
                    repo.Add(paths[i], false, monitor);
                }
            }

            NotifyFileStatusChanged(repo, parent.BaseDirectory, true);
        }
        void OnEntryAdded(object sender, SolutionItemEventArgs e)
        {
            ITreeBuilder tb;

            if (e.SolutionItem.ParentFolder == null)
            {
                tb = Context.GetTreeBuilder(e.SolutionItem.ParentSolution);
            }
            else
            {
                tb = Context.GetTreeBuilder(e.SolutionItem.ParentFolder);
            }

            if (tb != null)
            {
                tb.AddChild(e.SolutionItem, true);
            }
        }
Exemplo n.º 10
0
        private static void OnEntryAddedToCombine(object sender, SolutionItemEventArgs e)
        {
            ValaProject p = e.SolutionItem as ValaProject;

            if (p == null)
            {
                return;
            }

            foreach (ProjectPackage package in p.Packages)
            {
                if (!package.IsProject)
                {
                    ProjectInformationManager.Instance.Get(p).AddPackage(package.Name);
                }
            }
            foreach (ProjectFile f in p.Files)
            {
                ProjectInformationManager.Instance.Get(p).AddFile(f.FilePath);
            }
        }
 void ProjectSaved(object sender, SolutionItemEventArgs e)
 {
     projectSavedHandler(this, new EventArgs());
 }
Exemplo n.º 12
0
 void OnEntryChanged(object sender, SolutionItemEventArgs e)
 {
     UpdateTests();
 }
Exemplo n.º 13
0
 void HandleProjectSaved(object sender, SolutionItemEventArgs e)
 {
     UpdateCombos();
 }
Exemplo n.º 14
0
 protected override void OnSaved(SolutionItemEventArgs args)
 {
     NeedsFullRebuild = true;
     base.OnSaved(args);
 }