Beispiel #1
0
        public void CBExeScript(IAsyncResult ar)
        {
            DelExeScript del    = (DelExeScript)((AsyncResult)ar).AsyncDelegate;
            String       result = del.EndInvoke(ar);

            _core.DisplayMessage(result);
        }
Beispiel #2
0
 private String ExeScript(IClientToPuppet server, String[] words, String fullCommand)
 {
     if (words.Length < 3)
     {
         throw new CommandException("ClientProxy: ExeScript: Invalid number of arguments " + fullCommand);
     }
     try
     {
         String filename = words[2];
         //Read file
         Queue <String> commands           = _core.ReadFileName(words[2]);
         DelExeScript   remoteDelExeScript = new DelExeScript(server.ExeScript);
         AsyncCallback  remoteCallBack     = new AsyncCallback(CBExeScript);
         remoteDelExeScript.BeginInvoke(commands, remoteCallBack, null);
     }
     catch (InvalidCastException ex)
     {
         throw new CommandException("ClientProxy: ExeScript: Invalid arguments " + fullCommand + "Error: " + ex.Message);
     }
     return("Running execScript on Client");
 }