public void AddFolder(TernaryFolder folder) { if (!_Folders.ContainsKey(folder.Name)) { _Folders.Add(folder.Name, folder); } }
public void RemoveFolder(TernaryFolder folder) { if (_Folders.ContainsKey(folder.Name)) { _Folders.Remove(folder.Name); } }
private void CreateFolder(TernaryString fullName, Tryte attr) { TernaryFolder folder = new TernaryFolder(fullName.Trim('/'), attr); int index = folder.Name.IndexOf('/'); if (index > 0 && index != folder.Name.Length - 1) { TernaryString baseFolderName = folder.Name.Substring('/'); if (_Folders.ContainsKey(baseFolderName)) { _Folders[baseFolderName].AddFolder(folder); } else { throw new Exception($"Folder root folder '{baseFolderName}' Not Found"); } } else { _Folders.Add(folder.Name, folder); } }