Exemple #1
0
        /// <summary>
        /// 新建文件夹
        /// </summary>
        /// <param name="m_tree"></param>
        internal void NewFolder()
        {
            string                title      = XmlUtilService.CreateIncreaseFolderTitle(((BaseFolderElementNode)CurrentNode).Element as FolderXmlElement);
            SdsiteXmlDocument     doc        = Service.Sdsite.CurrentDocument;
            BaseFolderElementNode parentNode = (BaseFolderElementNode)CurrentNode;

            doc.CreateFolder(parentNode.Element.Id, title);
        }
Exemple #2
0
        /// <summary>
        /// 新建文件夹
        /// </summary>
        void NewResourcesFolder()
        {
            SdsiteXmlDocument doc             = Service.Sdsite.CurrentDocument;
            FolderXmlElement  parentFolderEle = filePaths[pathNum] as FolderXmlElement;
            FolderXmlElement  newFolderEle    = doc.CreateFolder(parentFolderEle, XmlUtilService.CreateIncreaseFolderTitle(parentFolderEle));

            Directory.CreateDirectory(newFolderEle.AbsoluteFilePath);

            MyFolderItem mylvi = new MyFolderItem(newFolderEle);

            listView.Items.Add(mylvi);

            KeyValuePair <string, Image> keyImg = GetImageAndKey(mylvi.Element.AbsoluteFilePath);

            if (!listView.SmallImageList.Images.ContainsKey(keyImg.Key))
            {
                listView.SmallImageList.Images.Add(keyImg.Key, keyImg.Value);
            }
            mylvi.ImageKey = keyImg.Key;

            mylvi.Selected = true;
            mylvi.BeginEdit();
        }