Beispiel #1
0
        public static void DoPaste(ISolutionFolderNode folderNode)
        {
            if (!DoEnablePaste(folderNode))
            {
                LoggingService.Warn("SolutionFolderNode.DoPaste: Pasting was not enabled.");
                return;
            }

            ExtTreeNode folderTreeNode = (ExtTreeNode)folderNode;
            IDataObject dataObject     = ClipboardWrapper.GetDataObject();

            if (dataObject.GetDataPresent(typeof(ISolutionFolder).ToString()))
            {
                string          guid           = dataObject.GetData(typeof(ISolutionFolder).ToString()).ToString();
                ISolutionFolder solutionFolder = folderNode.Solution.GetSolutionFolder(guid);
                if (solutionFolder != null)
                {
                    folderNode.Container.AddFolder(solutionFolder);
                    ExtTreeView treeView = (ExtTreeView)folderTreeNode.TreeView;
                    foreach (ExtTreeNode node in treeView.CutNodes)
                    {
                        ExtTreeNode oldParent = node.Parent as ExtTreeNode;
                        node.Remove();

                        node.AddTo(folderTreeNode);
                        if (oldParent != null)
                        {
                            oldParent.Refresh();
                        }
                    }
                    ProjectService.SaveSolution();
                }
            }
            folderTreeNode.Expand();
        }
        public static void DoPaste(ISolutionFolderNode folderNode)
        {
            System.Windows.IDataObject dataObject = SD.Clipboard.GetDataObject();
            if (!DoEnablePaste(folderNode.Folder, dataObject))
            {
                LoggingService.Warn("SolutionFolderNode.DoPaste: Pasting was not enabled.");
                return;
            }

            ExtTreeNode folderTreeNode = (ExtTreeNode)folderNode;

            if (dataObject.GetDataPresent(typeof(ISolutionItem).ToString()))
            {
                Guid          guid         = Guid.Parse(dataObject.GetData(typeof(ISolutionItem).ToString()).ToString());
                ISolutionItem solutionItem = folderNode.Solution.GetItemByGuid(guid);
                if (solutionItem != null)
                {
                    MoveItem(solutionItem, folderNode.Folder);
                    ExtTreeView treeView = (ExtTreeView)folderTreeNode.TreeView;
                    foreach (ExtTreeNode node in treeView.CutNodes)
                    {
                        ExtTreeNode oldParent = node.Parent as ExtTreeNode;
                        node.Remove();

                        node.InsertSorted(folderTreeNode);
                        if (oldParent != null)
                        {
                            oldParent.Refresh();
                        }
                    }
                    ProjectService.SaveSolution();
                }
            }
            folderTreeNode.Expand();
        }
Beispiel #3
0
 private void LoadBills()
 {
     string filename = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + Path.DirectorySeparatorChar + "Bills.xml";
     XmlDocument document = new XmlDocument();
     document.Load(filename);
     XmlElement documentElement = document.DocumentElement;
     if (documentElement != null)
     {
         ExtTreeNode parentNode = new ExtTreeNode();
         parentNode.ImageIndex = 1;
         parentNode.SelectedImageIndex = 1;
         parentNode.Text = documentElement.GetAttribute("name");
         this.LoadBillNodes(documentElement.ChildNodes, parentNode);
         this.billBrowserTreeView.Nodes.Add(parentNode);
         parentNode.Expand();
     }
 }