void OnChanged(object s, WindowEventArgs a)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(a.Window);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
        private void OnRemovePackage(object sender, ProjectPackageEventArgs e)
        {
            ITreeBuilder builder = Context.GetTreeBuilder(e.Project.Packages);

            if (builder != null)
            {
                builder.UpdateAll();
            }
        }
Exemple #3
0
        void UpdateTranslationNodes(object sender, EventArgs e)
        {
            ITreeBuilder treeBuilder = Context.GetTreeBuilder(sender);

            if (treeBuilder != null)
            {
                treeBuilder.UpdateAll();
            }
        }
        void RefreshNode(object project)
        {
            ITreeBuilder builder = GetBuilder((DnxProject)project);

            if (builder != null)
            {
                builder.UpdateAll();
            }
        }
Exemple #5
0
        void OnUpdateFiles(object s, EventArgs args)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(s);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
Exemple #6
0
        public void OnTestChanged(object sender, EventArgs args)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(sender);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
        void OnAddinSupportChanged(Project p, bool enabled)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(p);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
Exemple #8
0
        void ReferenceStatusChanged(object sender, EventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(sender);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
 void RefreshSolutionNode(Solution solution)
 {
     Runtime.RunInMainThread(() => {
         ITreeBuilder builder = Context.GetTreeBuilder(solution);
         if (builder != null)
         {
             builder.UpdateAll();
         }
     });
 }
        void OnProjectChanged(object s, EventArgs a)
        {
            AddinData    data = (AddinData)s;
            ITreeBuilder tb   = Context.GetTreeBuilder(data.Project);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
Exemple #11
0
        void HandleDataChanged(object sender, EventArgs e)
        {
            AddinData    data = (AddinData)sender;
            ITreeBuilder tb   = Context.GetTreeBuilder(data.Project);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
        /// <summary>
        /// Handles the services that have been added to the project by updating the services node
        /// </summary>
        void ServicesChanged(object sender, ServicesChangedEventArgs e)
        {
            ITreeBuilder builder = Context.GetTreeBuilder(sender);

            if (builder != null)
            {
                builder.UpdateAll();
                builder.Expanded = true;
            }
        }
        void OnFolderRenamed(object sender, FileCopyEventArgs e)
        {
            ProjectFolder f  = (ProjectFolder)sender;
            ITreeBuilder  tb = Context.GetTreeBuilder(f.Parent);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
        void OnNodeHidden(object sender, EventArgs args)
        {
            ITreeBuilder builder = Context.GetTreeBuilder(sender);

            if (builder != null)
            {
                builder.MoveToParent();
                builder.UpdateAll();
            }
        }
Exemple #15
0
 void RefreshProjectNode(Project project)
 {
     Runtime.RunInMainThread(() => {
         ITreeBuilder builder = Context.GetTreeBuilder(project);
         if (builder != null)
         {
             builder.UpdateAll();
         }
     });
 }
 void OnFilePropertyChanged(object sender, ProjectFileEventArgs e)
 {
     foreach (ProjectFileEventInfo args in e)
     {
         ITreeBuilder tb = Context.GetTreeBuilder(args.Project);
         if (tb != null)
         {
             tb.UpdateAll();
         }
     }
 }
Exemple #17
0
        private void OnConnectionRemoved(object sender, DatabaseConnectionContextEventArgs args)
        {
            ITreeBuilder builder = Context.GetTreeBuilder(args.ConnectionContext);

            if (builder.MoveToObject(args.ConnectionContext))
            {
                builder.Remove();
                builder.MoveToParent();
                builder.UpdateAll();
            }
        }
Exemple #18
0
 void OnFilePropertyChanged(object sender, ProjectFileEventArgs e)
 {
     foreach (var project in e.Where(x => propertiesThatAffectDisplay.Contains(x.Property)).Select(x => x.Project).Distinct())
     {
         ITreeBuilder tb = Context.GetTreeBuilder(project);
         if (tb != null)
         {
             tb.UpdateAll();
         }
     }
 }
        void RefreshChildNodes(DotNetProject project)
        {
            ITreeBuilder builder = Context.GetTreeBuilder(project);

            if (builder != null)
            {
                if (builder.MoveToChild("References", typeof(ProjectReferenceCollection)))
                {
                    builder.UpdateAll();
                    builder.MoveToParent();
                }

                if (builder.MoveToChild("Packages", typeof(ProjectPackagesFolderNode)))
                {
                    var packagesFolder = (ProjectPackagesFolderNode)builder.DataItem;
                    packagesFolder.ClearPackageReferences();
                    builder.UpdateAll();
                    builder.MoveToParent();
                }
            }
        }
        void Monitor(object sender, FileUpdateEventArgs args)
        {
            object obj;

            if (filePaths.TryGetValue(args.FilePath, out obj))
            {
                ITreeBuilder builder = Context.GetTreeBuilder(obj);
                if (builder != null)
                {
                    builder.UpdateAll();
                }
            }
        }
        public static void OnSupportChanged(Project p)
        {
            if (instance == null)
            {
                return;
            }

            ITreeBuilder tb = instance.Context.GetTreeBuilder(p);

            if (tb != null)
            {
                tb.UpdateAll();
            }
        }
Exemple #22
0
		void OnProjectModified (object sender, SolutionItemModifiedEventArgs args)
		{
			foreach (SolutionItemModifiedEventInfo e in args) {
				if (e.Hint == "References" || e.Hint == "Files")
					continue;
				ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
				if (tb != null) {
					if (e.Hint == "BaseDirectory" || e.Hint == "TargetFramework")
						tb.UpdateAll ();
					else
						tb.Update ();
				}
			}
		}
Exemple #23
0
        void OnSystemFileCreated(object sender, FileEventArgs args)
        {
            if (!args.Any(f => f.IsDirectory))
            {
                return;
            }

            // When a folder is created, we need to refresh the parent if the folder was created externally.
            ITreeBuilder tb   = Context.GetTreeBuilder();
            var          dirs = args.Where(d => d.IsDirectory).Select(d => d.FileName).ToArray();

            foreach (var p in IdeApp.Workspace.GetAllProjects())
            {
                foreach (var dir in dirs)
                {
                    if (tb.MoveToObject(new ProjectFolder(dir, p)))
                    {
                        if (tb.MoveToParent())
                        {
                            tb.UpdateAll();
                        }
                    }
                    else if (tb.MoveToObject(new ProjectFolder(dir.ParentDirectory, p)))
                    {
                        tb.UpdateAll();
                    }
                    else if (dir.ParentDirectory == p.BaseDirectory)
                    {
                        if (tb.MoveToObject(p))
                        {
                            tb.UpdateAll();
                        }
                    }
                }
            }
        }
Exemple #24
0
        void OnPackageDependenciesChanged(object sender, EventArgs e)
        {
            var          cache   = (PackageDependencyNodeCache)sender;
            ITreeBuilder builder = Context.GetTreeBuilder(cache.Project);

            if (builder == null)
            {
                return;
            }

            if (builder.MoveToChild(DependenciesNode.NodeName, typeof(DependenciesNode)))
            {
                builder.UpdateAll();
            }
        }
Exemple #25
0
        void RemoveFile(ProjectFile file, Project project)
        {
            ITreeBuilder tb = Context.GetTreeBuilder();

            if (file.Subtype == Subtype.Directory)
            {
                if (!tb.MoveToObject(new ProjectFolder(file.Name, project)))
                {
                    return;
                }
                tb.MoveToParent();
                tb.UpdateAll();
                return;
            }
            else
            {
                if (tb.MoveToObject(file))
                {
                    tb.Remove(true);
                }
                else
                {
                    // We can't use IsExternalToProject here since the ProjectFile has
                    // already been removed from the project
                    string parentPath = file.IsLink
                                                ? project.BaseDirectory.Combine(file.Link.IsNullOrEmpty? file.FilePath.FileName : file.Link.ToString()).ParentDirectory
                                                : file.FilePath.ParentDirectory;

                    if (!tb.MoveToObject(new ProjectFolder(parentPath, project)))
                    {
                        return;
                    }
                }
            }

            while (tb.DataItem is ProjectFolder)
            {
                ProjectFolder f = (ProjectFolder)tb.DataItem;
                if (!Directory.Exists(f.Path) && !project.Files.GetFilesInVirtualPath(f.Path.ToRelative(project.BaseDirectory)).Any())
                {
                    tb.Remove(true);
                }
                else
                {
                    break;
                }
            }
        }
        void OnFolderRemoved(object sender, FileEventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(sender);

            if (tb != null)
            {
                if (!tb.HasChildren())
                {
                    tb.Remove();
                }
                else
                {
                    tb.UpdateAll();
                }
            }
        }
Exemple #27
0
        void OnFileNestingRulesChanged(ProjectFile fileToUpdate, ProjectFile newParent)
        {
            Debug.Assert(fileToUpdate != null);

            ITreeBuilder tb = Context.GetTreeBuilder(fileToUpdate);

            if (tb != null)
            {
                tb.MoveToParent();
                tb.UpdateAll();
            }

            if (newParent != null)
            {
                tb = Context.GetTreeBuilder(newParent);
                tb?.UpdateAll();
            }
        }
Exemple #28
0
        void OnEntryAdded(object sender, SolutionItemChangeEventArgs e)
        {
            ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem.ParentSolution);

            if (tb != null)
            {
                if (e.Reloading)
                {
                    // When reloading we ignore the removed event, and we do an UpdateAll here. This will
                    // replace the reloaded instance and will preserve the tree status
                    tb.UpdateAll();
                }
                else
                {
                    tb.AddChild(e.SolutionItem, true);
                    tb.Expanded = true;
                }
            }
        }
 void Monitor(object sender, FileUpdateEventArgs args)
 {
     foreach (var dir in args.GroupByDirectory())
     {
         if (dir.Count() > 3 || dir.Any(f => f.IsDirectory))
         {
             FilePath path = dir.Key.CanonicalPath;
             DirData  dd;
             if (filePaths.TryGetValue(path, out dd))
             {
                 dd.FileData = null;                         // Clear the status cache
                 ITreeBuilder builder = Context.GetTreeBuilder(dd.Object);
                 if (builder != null)
                 {
                     builder.UpdateAll();
                 }
             }
             continue;
         }
         else
         {
             // All files, clear the cached version info for each file, if exists
             foreach (FileUpdateEventInfo uinfo in dir)
             {
                 FilePath path = uinfo.FilePath.ParentDirectory;
                 DirData  dd;
                 if (filePaths.TryGetValue(path.CanonicalPath, out dd) && dd.FileData != null)
                 {
                     dd.FileData.Remove(uinfo.FilePath.CanonicalPath);
                 }
                 if (filePaths.TryGetValue(uinfo.FilePath.CanonicalPath, out dd))
                 {
                     ITreeBuilder builder = Context.GetTreeBuilder(dd.Object);
                     if (builder != null)
                     {
                         builder.UpdateAll();
                     }
                 }
             }
         }
     }
 }
Exemple #30
0
        void OnProjectModified(object sender, SolutionItemModifiedEventArgs e)
        {
            if (e.Hint == "References" || e.Hint == "Files")
            {
                return;
            }
            ITreeBuilder tb = Context.GetTreeBuilder(e.SolutionItem);

            if (tb != null)
            {
                if (e.Hint == "BaseDirectory" || e.Hint == "TargetFramework")
                {
                    tb.UpdateAll();
                }
                else
                {
                    tb.Update();
                }
            }
        }