Esempio n. 1
0
 void OnItemRemoved(SolutionItemChangeEventArgs e)
 {
     if (ItemRemoved != null)
     {
         ItemRemoved(this, e);
     }
 }
		void SolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
		{
			var project = e.SolutionItem as DotNetProject;
			if (project != null) {
				projectAdded (this, new DotNetProjectEventArgs (project));
			}
		}
Esempio n. 3
0
 void HandleSolutionItemRemoved(object sender, SolutionItemChangeEventArgs e)
 {
     if (!e.Reloading && (e.SolutionItem is SolutionEntityItem))
     {
         dependencies.Remove((SolutionEntityItem)e.SolutionItem);
     }
 }
Esempio n. 4
0
        internal protected virtual void OnSolutionItemRemoved(SolutionItemChangeEventArgs args)
        {
            solutionItems = null;

            SolutionFolder sf = args.SolutionItem as SolutionFolder;

            if (sf != null)
            {
                foreach (SolutionEntityItem eitem in sf.GetAllItems <SolutionEntityItem> ())
                {
                    DetachItem(eitem, args.Reloading);
                }
            }
            else
            {
                SolutionEntityItem item = args.SolutionItem as SolutionEntityItem;
                if (item != null)
                {
                    DetachItem(item, args.Reloading);
                }
            }

            if (SolutionItemRemoved != null)
            {
                SolutionItemRemoved(this, args);
            }
        }
Esempio n. 5
0
        internal /*protected virtual*/ void OnSolutionItemAdded(SolutionItemChangeEventArgs args)
        {
            if (IsShared)
            {
                args.Solution.SetShared();
            }

            solutionItems = null;

            SolutionFolder sf = args.SolutionItem as SolutionFolder;

            if (sf != null)
            {
                foreach (SolutionFolderItem eitem in sf.GetAllItems <SolutionFolderItem> ())
                {
                    SetupNewItem(eitem, null);
                }
            }
            else
            {
                SetupNewItem(args.SolutionItem, args.ReplacedItem);
            }

            if (SolutionItemAdded != null)
            {
                SolutionItemAdded(this, args);
            }
        }
Esempio n. 6
0
 protected virtual void OnItemAdded(SolutionItemChangeEventArgs e)
 {
     if (ItemAdded != null)
     {
         ItemAdded(this, e);
     }
 }
Esempio n. 7
0
        void OnItemAdded(SolutionItemChangeEventArgs e, bool newToSolution)
        {
            NotifyItemAddedToFolder(this, e, newToSolution);

            // Fire the event after notifying the parent because the parent may need to complete
            // some data initialization before the item is accessible to the clients. For example,
            // the solution needs to setup the configuration maps.
            OnItemAdded(e);
        }
		public static ProjectReloadedEventArgs Create (SolutionItemChangeEventArgs eventArgs)
		{
			DotNetProject newProject = eventArgs.SolutionItem as DotNetProject;
			DotNetProject oldProject = eventArgs.ReplacedItem as DotNetProject;
			if (eventArgs.Reloading && (newProject != null) && (oldProject != null)) {
				return new ProjectReloadedEventArgs (oldProject, newProject);
			}
			return null;
		}
        static void OnSolutionItemAdded(object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
        {
            var project = args.SolutionItem as MonoDevelop.Projects.Project;

            if (project != null)
            {
                Unload(project.ParentSolution);
                Load(project.ParentSolution, null).Ignore();
            }
        }
        static async void OnSolutionItemAdded(object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
        {
            var project = args.SolutionItem as MonoDevelop.Projects.Project;

            if (project != null)
            {
                Unload(project.ParentSolution);
                await Load(project.ParentSolution, new ProgressMonitor());
            }
        }
Esempio n. 11
0
 void HandleSolutionItemAdded(object sender, SolutionItemChangeEventArgs e)
 {
     if (e.Reloading && dependencies.Count > 0 && (e.SolutionItem is SolutionEntityItem) && (e.ReplacedItem is SolutionEntityItem))
     {
         int i = dependencies.IndexOf((SolutionEntityItem)e.ReplacedItem);
         if (i != -1)
         {
             dependencies [i] = (SolutionEntityItem)e.SolutionItem;
         }
     }
 }
        static void OnSolutionItemRemoved(object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
        {
            var project  = args.SolutionItem as MonoDevelop.Projects.Project;
            var solution = sender as MonoDevelop.Projects.Solution;

            if (project != null)
            {
                var ws = GetWorkspace(solution);
                ws.RemoveProject(project);
            }
        }
 internal void NotifyItemAddedToFolder(object sender, SolutionItemChangeEventArgs e, bool newToSolution)
 {
     if (ParentFolder != null)
     {
         ParentFolder.NotifyItemAddedToFolder(sender, e, newToSolution);
     }
     else if (ParentSolution != null && newToSolution)
     {
         ParentSolution.OnSolutionItemAdded(e);
     }
     DescendantItemAdded?.Invoke(sender, e);
 }
 internal void NotifyItemRemovedFromFolder(object sender, SolutionItemChangeEventArgs e, bool removedFromSolution)
 {
     DescendantItemRemoved?.Invoke(sender, e);
     if (ParentFolder != null)
     {
         ParentFolder.NotifyItemRemovedFromFolder(sender, e, removedFromSolution);
     }
     else if (ParentSolution != null && removedFromSolution)
     {
         ParentSolution.OnSolutionItemRemoved(e);
     }
 }
        static async void OnSolutionItemAdded(object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
        {
            try {
                var project = args.SolutionItem as MonoDevelop.Projects.Project;
                if (project != null)
                {
                    var ws          = GetWorkspace(args.Solution);
                    var projectInfo = await ws.LoadProject(project, CancellationToken.None, args.ReplacedItem as MonoDevelop.Projects.Project);

                    if (args.Reloading)
                    {
                        ws.OnProjectReloaded(projectInfo);
                    }
                    else
                    {
                        ws.OnProjectAdded(projectInfo);
                    }
                }
            } catch (Exception ex) {
                LoggingService.LogError("OnSolutionItemAdded failed", ex);
            }
        }
        async void OnSolutionItemAdded(object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
        {
            try {
                var project = args.SolutionItem as MonoDevelop.Projects.Project;
                if (project != null)
                {
                    var ws         = GetWorkspace(args.Solution);
                    var oldProject = args.ReplacedItem as MonoDevelop.Projects.Project;

                    // when loading a project that was unloaded manually before
                    // args.ReplacedItem is the UnloadedSolutionItem, which is not useful
                    // we need to find what was the real project previously
                    if (args.Reloading && oldProject == null)
                    {
                        var existingRoslynProject = ws.CurrentSolution.Projects.FirstOrDefault(p => p.FilePath == project.FileName);
                        if (existingRoslynProject != null)
                        {
                            oldProject = ws.GetMonoProject(existingRoslynProject.Id);
                        }
                    }

                    var projectInfo = await ws.LoadProject(project, CancellationToken.None, oldProject);

                    if (oldProject != null)
                    {
                        projectInfo = ws.AddVirtualDocuments(projectInfo);
                        ws.OnProjectReloaded(projectInfo);
                    }
                    else
                    {
                        ws.OnProjectAdded(projectInfo);
                    }
                    ws.ReloadModifiedProject(project);
                    Runtime.RunInMainThread(() => IdeServices.TypeSystemService.UpdateRegisteredOpenDocuments()).Ignore();
                }
            } catch (Exception ex) {
                LoggingService.LogError("OnSolutionItemAdded failed", ex);
            }
        }
Esempio n. 17
0
        internal protected virtual void OnSolutionItemAdded(SolutionItemChangeEventArgs args)
        {
            solutionItems = null;

            SolutionFolder sf = args.SolutionItem as SolutionFolder;

            if (sf != null)
            {
                foreach (SolutionItem eitem in sf.GetAllItems <SolutionItem> ())
                {
                    SetupNewItem(eitem);
                }
            }
            else
            {
                SetupNewItem(args.SolutionItem);
            }

            if (SolutionItemAdded != null)
            {
                SolutionItemAdded(this, args);
            }
        }
Esempio n. 18
0
		void OnEntryRemoved (object sender, SolutionItemChangeEventArgs e)
		{
			ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
			if (tb != null)
				tb.Remove ();
		}
Esempio n. 19
0
		void OnEntryAdded (object sender, SolutionItemChangeEventArgs e)
		{
			ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem.ParentSolution);
			if (tb != null) {
				tb.AddChild (e.SolutionItem, true);
				tb.Expanded = true;
			}
		}
Esempio n. 20
0
		void OnSolutionItemAddedRemoved (object sender, SolutionItemChangeEventArgs e)
		{
			ITreeBuilder tb = Context.GetTreeBuilder (e.Solution);
			if (tb != null)
				tb.Update ();	// Update the entry count
		}
		void OnEntryRemoved (object sender, SolutionItemChangeEventArgs e)
		{
			// If reloading, ignore the event. We handle it in OnEntryAdded.
			if (e.Reloading)
				return;

			ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
			if (tb != null)
				tb.Remove ();
		}
Esempio n. 22
0
		void HandleSolutionSolutionItemRemoved (object sender, SolutionItemChangeEventArgs e)
		{
			if (e.SolutionItem is DotNetProject) {
				projectTimestamps.Remove ((DotNetProject)e.SolutionItem);
				OnChanged ();
			}
		}
 void OnItemRemoved(SolutionItemChangeEventArgs e)
 {
     ItemRemoved?.Invoke(this, e);
 }
Esempio n. 24
0
		static void OnSolutionItemRemoved (object sender, SolutionItemChangeEventArgs args)
		{
			if (args.SolutionItem is Project)
				Unload ((Project) args.SolutionItem);
		}
 static void OnSolutionItemAdded(object o, SolutionItemChangeEventArgs args)
 {
     if (args.SolutionItem is DotNetProject) {
         OnProjectAdded((DotNetProject)args.SolutionItem);
     }
 }
		void SolutionItemAddedOrRemoved (object sender, SolutionItemChangeEventArgs e)
		{
			var solutionManager = (MonoDevelopSolutionManager) GetSolutionManager (e.Solution);
			solutionManager.ClearProjectCache ();
		}
		void OnEntryAdded (object sender, SolutionItemChangeEventArgs e)
		{
			ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem.ParentFolder);
			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;
				}
			}
		}
Esempio n. 28
0
		void OnItemsChangedInSolution (object sender, SolutionItemChangeEventArgs e)
		{
			if (!IsSolutionGroupPresent (e.Solution, rootTests))
				RebuildTests ();
		}
		void SolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
		{
			if (!e.Reloading)
				return;

			var handler = ProjectReloaded;
			if (handler != null) {
				ProjectReloadedEventArgs reloadedEventArgs = ProjectReloadedEventArgs.Create (e);
				if (reloadedEventArgs != null) {
					handler (this, reloadedEventArgs);
				}
			}
		}
Esempio n. 30
0
		void HandleSolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
		{
			var newProject = e.SolutionItem as Project;
			if (newProject == null)
				return;
			UpdateCommentTagsForProject (e.Solution, newProject);
		}
Esempio n. 31
0
 void OnItemRemoved(SolutionItemChangeEventArgs e, bool removedFromSolution)
 {
     OnItemRemoved(e);
     NotifyItemRemovedFromFolder(this, e, removedFromSolution);
 }