示例#1
0
 public TMFolder(string name, TMFolder parent)
 {
     _folders    = new TMFolderCollection(this);
     _files      = new TMFileCollection(this);
     _name       = name;
     _parent     = parent;
     _rootFolder = this.GetRootFolder() as TMRootFolder;
     _fullName   = this.GetPath();
 }
示例#2
0
 public static void LoadFileSystem(EasyPropertiesNode pnode, TMFileSystem fileSystem)
 {
     foreach (EasyPropertiesNode node in pnode.GetChildProperties())
     {
         TMRootFolder rootFolder = new TMRootFolder((LURootFolderType)Enum.Parse(typeof(LURootFolderType), node.Name));
         LoadFolders(node, rootFolder);
         LoadFiles(node, rootFolder);
         fileSystem.Add(rootFolder);
     }
 }
示例#3
0
        public new TMRootFolder Clone(TMFolder parent)
        {
            TMRootFolder rootFolder = new TMRootFolder(_rootFolderType);

            foreach (TMFolder childFolder in this.Folders)
            {
                rootFolder.Folders.Add(childFolder.Clone(rootFolder));
            }
            foreach (TMFile file in this.Files)
            {
                rootFolder.Files.Add(file.Clone(rootFolder));
            }
            return(rootFolder);
        }
示例#4
0
        /// <summary>
        /// Create new project
        /// </summary>
        /// <param name="projectFile"></param>
        /// <param name="luAppDirectory"></param>
        public Project(FileInfo projectFile, DirectoryInfo luAppDirectory) : this()
        {
            _projectFile = projectFile;

            TMRootFolder appRootFolder = new TMRootFolder(LURootFolderType.Application);

            _fileSystem.Add(appRootFolder);
            this.JoinDirectory(appRootFolder, luAppDirectory);

            _appDirectory       = luAppDirectory;
            _appUpdateDirectory = new DirectoryInfo(Path.Combine(luAppDirectory.FullName, "Update"));

            VersionInfo version = this.CreateNewVersion();

            this.ApplyVersion(version, true);
            this.Save();
        }
示例#5
0
        private void tvCMMenuItem_Click(object sender, EventArgs e)
        {
            if (sender is TMSpecFolderMenuItem)
            {
                TMSpecFolderMenuItem menuItem   = sender as TMSpecFolderMenuItem;
                TMRootFolder         rootFolder = new TMRootFolder(menuItem.SpecialFolder);

                _project.FileSystem.Add(rootFolder);
                _treeViewFileSystem.Nodes[0].Nodes.Add(new TMRootFolderNode(rootFolder));
                this.OnDataChanged();
            }
            else if (sender is TMContextMenuItem)
            {
                TMContextMenuItem menuItem   = sender as TMContextMenuItem;
                TMFolderNode      folderNode = this._treeViewFileSystem.SelectedNode as TMFolderNode;
                if (folderNode == null || menuItem == null)
                {
                    return;
                }

                switch (menuItem.Action)
                {
                case TMContextMenuAction.Delete:
                    this.DeleteFolder(folderNode);
                    break;

                case TMContextMenuAction.AddFile:
                    this.AddFile(folderNode.Folder);
                    break;

                case TMContextMenuAction.AddFolder:
                    this.AddFolder(folderNode);
                    break;
                }
            }
        }
示例#6
0
 public TMRootFolderNode(TMRootFolder rootFolder) : base(rootFolder)
 {
 }