Beispiel #1
0
        public override void DoDragDrop(IDataObject dataObject, DragDropEffects effect)
        {
            AbstractProjectBrowserTreeNode parentNode = null;

            if (dataObject.GetDataPresent(typeof(SolutionFolderNode)))
            {
                SolutionFolderNode folderNode = (SolutionFolderNode)dataObject.GetData(typeof(SolutionFolderNode));
                parentNode = folderNode.Parent as AbstractProjectBrowserTreeNode;

                folderNode.Remove();
                folderNode.InsertSorted(this);

                SolutionFolderNode.MoveItem(folderNode.Folder, this.solution);
            }
            if (dataObject.GetDataPresent(typeof(ProjectNode)))
            {
                ProjectNode projectNode = (ProjectNode)dataObject.GetData(typeof(ProjectNode));
                parentNode = projectNode.Parent as AbstractProjectBrowserTreeNode;

                projectNode.Remove();
                projectNode.InsertSorted(this);
                projectNode.EnsureVisible();
                SolutionFolderNode.MoveItem(projectNode.Project, this.solution);
            }

            if (parentNode != null)
            {
                parentNode.Refresh();
            }


            solution.Save();
        }
        public override void DoDragDrop(IDataObject dataObject, DragDropEffects effect)
        {
            if (!isInitialized)
            {
                Initialize();
                isInitialized = true;
            }

            if (dataObject.GetDataPresent(typeof(SolutionFolderNode)))
            {
                SolutionFolderNode             folderNode = (SolutionFolderNode)dataObject.GetData(typeof(SolutionFolderNode));
                AbstractProjectBrowserTreeNode parentNode = folderNode.Parent as AbstractProjectBrowserTreeNode;

                folderNode.Remove();
                folderNode.InsertSorted(this);
                folderNode.EnsureVisible();
                this.folder.AddFolder(folderNode.Folder);
                if (parentNode != null)
                {
                    parentNode.Refresh();
                }
            }

            if (dataObject.GetDataPresent(typeof(SolutionItemNode)))
            {
                SolutionItemNode solutionItemNode = (SolutionItemNode)dataObject.GetData(typeof(SolutionItemNode));

                ISolutionFolderNode folderNode = (ISolutionFolderNode)solutionItemNode.Parent;
                folderNode.Container.SolutionItems.Items.Remove(solutionItemNode.SolutionItem);
                Container.SolutionItems.Items.Add(solutionItemNode.SolutionItem);

                solutionItemNode.Remove();
                solutionItemNode.InsertSorted(this);
                solutionItemNode.EnsureVisible();
                if (solutionItemNode.Parent != null)
                {
                    ((ExtTreeNode)solutionItemNode.Parent).Refresh();
                }
            }

            if (dataObject.GetDataPresent(typeof(ProjectNode)))
            {
                ProjectNode projectNode = (ProjectNode)dataObject.GetData(typeof(ProjectNode));

                projectNode.Remove();
                projectNode.InsertSorted(this);
                projectNode.EnsureVisible();
                this.folder.AddFolder(projectNode.Project);

                if (projectNode.Parent != null)
                {
                    ((ExtTreeNode)projectNode.Parent).Refresh();
                }
            }

            solution.Save();
        }
        //public override void DoDragDrop(IDataObject dataObject, DragDropEffects effect)
        public virtual void DoDragDrop(IDataObject dataObject, DragDropEffects effect)
        {
            if (!IsInitialized)
            {
                Initialize();
                //isInitialized = true;
            }

            if (dataObject.GetDataPresent(typeof(SolutionFolderNode)))
            {
                SolutionFolderNode             folderNode = (SolutionFolderNode)dataObject.GetData(typeof(SolutionFolderNode));
                AbstractProjectBrowserTreeNode parentNode = folderNode.Parent as AbstractProjectBrowserTreeNode;

                folderNode.Remove();
                folderNode.InsertSorted(this);
                folderNode.EnsureVisible();
                MoveItem(folderNode.Folder, this.folder);

                if (parentNode != null)
                {
                    parentNode.Refresh();
                }
            }

            if (dataObject.GetDataPresent(typeof(SolutionItemNode)))
            {
                SolutionItemNode solutionItemNode = (SolutionItemNode)dataObject.GetData(typeof(SolutionItemNode));

                MoveItem(solutionItemNode.SolutionItem, this.folder);

                solutionItemNode.Remove();
                solutionItemNode.InsertSorted(this);
                solutionItemNode.EnsureVisible();
                if (solutionItemNode.Parent != null)
                {
                    ((ExtTreeNode)solutionItemNode.Parent).Refresh();
                }
            }

            if (dataObject.GetDataPresent(typeof(ProjectNode)))
            {
                ProjectNode projectNode = (ProjectNode)dataObject.GetData(typeof(ProjectNode));

                projectNode.Remove();
                projectNode.InsertSorted(this);
                projectNode.EnsureVisible();
                MoveItem(projectNode.Project, this.folder);

                if (projectNode.Parent != null)
                {
                    ((ExtTreeNode)projectNode.Parent).Refresh();
                }
            }

            solution.Save();
        }
		public override object Visit(SolutionFolderNode solutionFolderNode, object data)
		{
			if (folder == solutionFolderNode.Folder) {
				ExtTreeNode parent = solutionFolderNode.Parent as ExtTreeNode;
				solutionFolderNode.Remove();
				if (parent != null) {
					parent.Refresh();
				}
			} else {
				solutionFolderNode.AcceptChildren(this, data);
			}
			return data;
		}
 public override object Visit(SolutionFolderNode solutionFolderNode, object data)
 {
     if (folder == solutionFolderNode.Folder)
     {
         ExtTreeNode parent = solutionFolderNode.Parent as ExtTreeNode;
         solutionFolderNode.Remove();
         if (parent != null)
         {
             parent.Refresh();
         }
     }
     else
     {
         solutionFolderNode.AcceptChildren(this, data);
     }
     return(data);
 }