Exemple #1
0
 public void AddFolder(TernaryFolder folder)
 {
     if (!_Folders.ContainsKey(folder.Name))
     {
         _Folders.Add(folder.Name, folder);
     }
 }
Exemple #2
0
 public void RemoveFolder(TernaryFolder folder)
 {
     if (_Folders.ContainsKey(folder.Name))
     {
         _Folders.Remove(folder.Name);
     }
 }
Exemple #3
0
        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);
            }
        }