Пример #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);
        }