Example #1
0
 private void ListStores(object sender, EventCmdArgs args)
 {
     string printout = "List of Stores:\n";
     for (int i = 0; i < FileStores.Count; i++)
         printout += i + ". " + FileStores[i].Name + "\n";
     args.ConsoleCaller.Print(printout);
 }
Example #2
0
 private void PollList(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 1)
         PollList(FileStores[Convert.ToInt32(args.Arguments[0])]);
     else
         CmdConsole.Print("Usage: poll_list [store]");
 }
Example #3
0
 private void AddStore(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 2)
     {
         Guid storeID = AddStore(ID, args.Arguments[0]);
         FileStores.Add(new FileStore(storeID, args.Arguments[0], args.Arguments[1]));
     }
     else
         CmdConsole.Print("Usage: add_store [name] [physical_path]");
 }
Example #4
0
 private void ListStoreEntries(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 1)
     {
         StringBuilder builder = new StringBuilder();
         foreach (FileEntry entry in FileStores[Convert.ToInt32(args.Arguments[0])].EntryTree.Entries)
             builder.AppendLine(entry.ToString());
         CmdConsole.Print(builder.ToString());
     }
     else
         CmdConsole.Print("Usage: list_store_entries [store]");
 }
Example #5
0
 private void Register(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 3)
     {
         Host = "http://" + args.Arguments[0] + "/";
         Name = args.Arguments[2];
         Register(args.Arguments[1], Name);
     }
     else
     {
         args.ConsoleCaller.Print("Usage: register [host] [access_token] [name]");
     }
 }
 private void Exec(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 1)
         Execute(args.Arguments[0]);
     else
         Print("Usage: exec [file_path]");
 }
Example #7
0
 protected virtual void LoadState(object sender, EventCmdArgs args)
 {
     LoadState();
 }
Example #8
0
 protected virtual void SaveState(object sender, EventCmdArgs args)
 {
     SaveState();
 }
Example #9
0
 private void Validate(object sender, EventCmdArgs args)
 {
     Validate();
 }
Example #10
0
 static void Quit(object sender, EventCmdArgs args)
 {
     Running = false;
 }
Example #11
0
 //Console Commands
 //list all registered nodes
 private void ListNodes(object sender, EventCmdArgs args)
 {
     string printout = "List of Nodes:\n";
     for (int i = 0; i < nodeList.Count; i++)
         printout += i + ". " + nodeList[i].ToString() + "\n";
     args.ConsoleCaller.Print(printout);
 }
Example #12
0
 //disallow node access to file
 private void RevokeEntry(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 2)
     {
         int id = Convert.ToInt32(args.Arguments[0]);
         RevokeEntry(storeList[id], args.Arguments[1]);
     }
     else
     {
         CmdConsole.Print("Usage: revoke_entry [store] [virtual_path]");
     }
 }
Example #13
0
 //allow node access to file
 private void PermitEntry(object sender, EventCmdArgs args)
 {
     if (args.Arguments.Length == 2)
     {
         int id = Convert.ToInt32(args.Arguments[0]);
         if (id < 0 || id >= storeList.Count)
         {
             CmdConsole.Print(VerboseTag.Warning, "Node ID doesn't exist", true);
             return;
         }
         PermitEntry(storeList[id], args.Arguments[1]);
     }
     else
     {
         CmdConsole.Print("Usage: permit_entry [store] [virtual_path]");
     }
 }
Example #14
0
        //list store file entries
        private void ListStoreEntries(object sender, EventCmdArgs args)
        {
            if (args.Arguments.Length == 1)
            {
                int id = Convert.ToInt32(args.Arguments[0]);
                string printout = "File Entries:\n";

                foreach (FileEntry file in storeList[id].EntryTree.Entries)
                    printout += file.ToString() + "\n";
                args.ConsoleCaller.Print(printout);
            }
            else
            {
                CmdConsole.Print("Usage: list_store_entries [id]");
            }
        }
Example #15
0
 //list all file entries on console
 private void ListEntries(object sender, EventCmdArgs args)
 {
     string printout = "File Entries:\n";
     foreach (FileEntry file in Entries.Entries)
         printout += file.ToString() + "\n";
     args.ConsoleCaller.Print(printout);
 }