예제 #1
0
        public Folder Add(string name)
        {
            var newFolder = new Folder(name);
            newFolder.Parent = _parent;

            Add(newFolder);

            return newFolder;
        }
예제 #2
0
        private void AddSubFolderNodes(Folder folder, TreeNode folderNode)
        {
            foreach (Folder subFolder in folder.Folders)
            {
                var subFolderNode = new TreeNode(subFolder.Name);
                subFolderNode.Tag = subFolder;
                folderNode.Nodes.Add(subFolderNode);

                AddSubFolderNodes(subFolder, subFolderNode);
            }

            tvwFolders.Sort();
        }
예제 #3
0
        private static void SetFolderItemParents(Folder folder)
        {
            folder.Items.Parent = folder;

            foreach (Item item in folder.Items)
            {
                item.Parent = folder;
            }

            folder.Folders.Parent = folder;

            foreach (Folder subFolder in folder.Folders)
            {
                subFolder.Parent = folder;
                SetFolderItemParents(subFolder);
            }
        }
예제 #4
0
        private void ToggleFolderCommands(Folder folder)
        {
            var isRootNodeSelected = (folder == _database);

            mnuFolderRename.Enabled = !isRootNodeSelected;
            mnuFolderDelete.Enabled = !isRootNodeSelected;

            cmsFolderRename.Enabled = !isRootNodeSelected;
            cmsFolderDelete.Enabled = !isRootNodeSelected;

            tbbFolderRename.Enabled = !isRootNodeSelected;
            tbbFolderDelete.Enabled = !isRootNodeSelected;
        }
예제 #5
0
        private void RepairFolder(Folder folder)
        {
            foreach (Item item in folder.Items)
            {
                if (item.Type == ItemType.Secret)
                    continue;

                if (RegexHelper.UrlRegex.IsMatch(item.Value))
                    item.Type = ItemType.Url;

                else if (RegexHelper.EMailRegex.IsMatch(item.Value))
                    item.Type = ItemType.EMail;

                else
                    item.Type = ItemType.Text;
            }

            foreach (Folder subFolder in folder.Folders)
                RepairFolder(subFolder);
        }
예제 #6
0
 public void Remove(Folder folder)
 {
     List.Remove(folder);
 }
예제 #7
0
        public void Add(Folder folder)
        {
            folder.Parent = _parent;

            List.Add(folder);
        }