示例#1
0
        public bool Run(ICommandInteraction writer, PathToken path)
        {
            if(!File.Exists(path.Value))
            {
                writer.WriteError(String.Format("No such file {0}.", path.Value));
                return false;
            }

            using(var progress = EmulationManager.Instance.ProgressMonitor.Start("Including script: " + path.Value))
            {
                bool result = false;
                switch(Path.GetExtension(path.Value))
                {
                case ".py":
                    result = PythonExecutor(path.Value, writer);
                    break;
                case ".cs":
                    result = CsharpExecutor(path.Value, writer);
                    break;
                default:
                    result = ScriptExecutor(path.Value);
                    break;
                }

                return result;
            }
        }
示例#2
0
 public void Run(ICommandInteraction writer, PathToken path)
 {
     if(IncludeCommand.Run(writer, path))
     {
         EmulationManager.Instance.CurrentEmulation.StartAll();
     }
 }
示例#3
0
 public void Run(PathToken path)
 {
     Logger.AddBackend(new FileBackend(path.Value), "file", true);
 }