public PSExecCommandForm(ExtendedForm parentForm, Device device) : base(parentForm) { InitializeComponent(); this.DisableDoubleBuffering(); targetDevice = device; pSExecWrapper = new PSExecWrapper(device.HostName); pSExecWrapper.ErrorReceived += PSExecWrapper_ErrorReceived; pSExecWrapper.OutputReceived += PSExecWrapper_OutputReceived; this.Text += " - " + device.CurrentUser; this.Show(); }
public void UsePsExec() { if (pSExecWrapper == null) { pSExecWrapper = new PSExecWrapper(targetDevice.HostName); pSExecWrapper.ErrorReceived -= PsExecErrorReceived; pSExecWrapper.ErrorReceived += PsExecErrorReceived; pSExecWrapper.OutputReceived -= PsExecOutputReceived; pSExecWrapper.OutputReceived += PsExecOutputReceived; } }