예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 override public bool AddChild(FileTreeNode node)
 {
     childs[node.name] = node;
     node.parent       = this;
     return(true);
 }
예제 #4
0
 virtual public bool AddChild(FileTreeNode node)
 {
     return(false);
 }
예제 #5
0
 public bool IsFolder(FileTreeNode node)
 {
     return(node is Folder);
 }
예제 #6
0
 public bool IsFile(FileTreeNode node)
 {
     return(node is File);
 }