public Folder Add(string name) { var newFolder = new Folder(name); newFolder.Parent = _parent; Add(newFolder); return newFolder; }
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(); }
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); } }
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; }
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); }
public void Remove(Folder folder) { List.Remove(folder); }
public void Add(Folder folder) { folder.Parent = _parent; List.Add(folder); }