public Program FindProgram(String name) { if (filenode.childs.Contains(name)) { FileTreeNode prog = (FileTreeNode)filenode.childs[name]; if (prog is Program) { return((Program)prog); } } if (computer.filetree.root.childs.Contains("bin")) { Folder bin = (Folder)computer.filetree.root.childs["bin"]; if (bin.childs.Contains(name)) { FileTreeNode prog = (FileTreeNode)bin.childs[name]; if (prog is Program) { return((Program)prog); } } } return(null); }
public LuaTable GetNodeChilds(Lua state, FileTreeNode node) { state.NewTable("__a__"); LuaTable table = state.GetTable("__a__"); foreach (FileTreeNode child in node.childs.Values) { table[child.name] = child; } return(table); }
override public bool AddChild(FileTreeNode node) { childs[node.name] = node; node.parent = this; return(true); }
virtual public bool AddChild(FileTreeNode node) { return(false); }
public bool IsFolder(FileTreeNode node) { return(node is Folder); }
public bool IsFile(FileTreeNode node) { return(node is File); }