예제 #1
0
 PowerShellInstance createInstance(
     IShellUI ui, string remoteComputerName)
 {
     var instance = new PowerShellInstance(ui, remoteComputerName);
     instance.ExecDone += onExecDone;
     instance.ExitRequested += onExitRequested;
     return instance;
 }
예제 #2
0
 public void Execute(string[] argStrings, IShellUI ui, ICore core)
 {
     try
     {
         string      sourcePath  = argStrings[1];
         string      outputPath  = argStrings[2];
         string      fileName    = argStrings[3];
         Compilation compilation = new Compilation(sourcePath, outputPath, fileName);
     }
     catch (Exception e) //TODO: Better exception handling
     {
         Console.WriteLine("Compilation Error\n");
         Console.WriteLine(e);
         Console.WriteLine("Please try again! type -h for help.\n");
     }
 }
예제 #3
0
        public void Execute(string[] argStrings, IShellUI ui, ICore core)
        {
            string path = argStrings[1];

            try
            {
                if (path != null)
                {
                    core.ChangeDirectory(path);
                    ui.DisplayChangeDirectory();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
예제 #4
0
 public void Execute(string[] argStrings, IShellUI ui, ICore core)
 {
     ui.DisplayHelp();
 }
예제 #5
0
 public ShellController(IShellUI ui, ICore core)
 {
     Ui   = ui;
     Core = core;
     ui.CommandEntered += Ui_CommandEntered;
 }
예제 #6
0
 public PowerShellEngine(IShellUI ui)
 {
     host = new CustomHost(ui);
     createRunspace(host);
 }
예제 #7
0
 public CustomHostUI(IShellUI shellUI)
 {
     this.shellUI = shellUI;
 }
예제 #8
0
 public void Execute(string[] argStrings, IShellUI ui, ICore core)
 {
     Process.GetCurrentProcess().Kill();
 }
예제 #9
0
 public CustomHost(IShellUI shellUI)
 {
     this.shellUI = shellUI;
     UI = new CustomHostUI(shellUI);
 }
예제 #10
0
 public PowerShellEngine(IShellUI ui)
 {
     this.ui = ui;
     instances.AddFirst(createInstance(ui, null));
 }