public void ReturnToRoot()
 {
     if (openedStorage != OpenedStorage.NONE)
     {
         fileBrowsingState = FileBrowsingState.AT_ROOT;
         currentNode       = null;
         if (openedStorage == OpenedStorage.PERSONAL_DEVICE_STORAGE)
         {
             childNodes = personalDeviceStorage.GetNodesAt("");
         }
         else
         {
             childNodes = connectedStorage.GetNodesAt("");
         }
     }
 }
    public OpenNodeStatus OpenAnyNode(string name, string directory)
    {
        FileNode nodeToOpen;

        if (openedStorage == OpenedStorage.PERSONAL_DEVICE_STORAGE)
        {
            nodeToOpen = personalDeviceStorage.GetNode(name, directory);
        }
        else if (openedStorage == OpenedStorage.CONNECTED_STORAGE)
        {
            nodeToOpen = connectedStorage.GetNode(name, directory);
        }
        else
        {
            return(OpenNodeStatus.NODE_NOT_FOUND);
        }
        if (nodeToOpen == null)
        {
            return(OpenNodeStatus.NODE_NOT_FOUND);
        }
        switch (nodeToOpen.type)
        {
        case NodeType.DIRECTORY:
            currentNode = nodeToOpen;
            if (openedStorage == OpenedStorage.PERSONAL_DEVICE_STORAGE)
            {
                childNodes = personalDeviceStorage.GetNodesAt($"{currentNode.directory}{currentNode.name}/");
            }
            else
            {
                childNodes = connectedStorage.GetNodesAt($"{currentNode.directory}{currentNode.name}/");
            }
            break;

        case NodeType.TEXT:
            fileTerminal.FeedLine(nodeToOpen.content);
            break;
        }
        nodeToOpen.locked = false;
        fileBrowsingState = FileBrowsingState.BROWSING_FILE;
        return(OpenNodeStatus.SUCCESSFUL);
    }
 public void ReturnToChoosingStorage()
 {
     fileBrowsingState = FileBrowsingState.CHOOSING_STORAGE;
     openedStorage     = OpenedStorage.NONE;
     currentNode       = null;
 }