public CimOperationOptions(bool mustUnderstand) { this._operationCallback = new OperationCallbacks(); this._writeMessageCallback = null; this._writeProgressCallback = null; this._writeErrorCallback = null; this._promptUserCallback = null; }
public CimOperationOptions(bool mustUnderstand) { this._operationCallback = new OperationCallbacks(); this._writeMessageCallback = null; this._writeProgressCallback = null; this._writeErrorCallback = null; this._promptUserCallback = null; }
public CimOperationOptions(CimOperationOptions optionsToClone) { if (optionsToClone == null) { throw new ArgumentNullException("optionsToClone"); } this._operationCallback = optionsToClone.GetOperationCallbacks(); this._writeMessageCallback = optionsToClone._writeMessageCallback; this._writeProgressCallback = optionsToClone._writeProgressCallback; this._writeErrorCallback = optionsToClone._writeErrorCallback; this._promptUserCallback = optionsToClone._promptUserCallback; }
public CimOperationOptions(CimOperationOptions optionsToClone) { if (optionsToClone == null) { throw new ArgumentNullException("optionsToClone"); } this._operationCallback = optionsToClone.GetOperationCallbacks(); this._writeMessageCallback = optionsToClone._writeMessageCallback; this._writeProgressCallback = optionsToClone._writeProgressCallback; this._writeErrorCallback = optionsToClone._writeErrorCallback; this._promptUserCallback = optionsToClone._promptUserCallback; }
/// <summary> /// Writes the message. /// </summary> /// <param name="message">The message.</param> public void WriteMessage(string message) { // https://msdn.microsoft.com/en-us/library/ms171728.aspx // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.txtUpdateMessages.InvokeRequired) { WriteMessageCallback d = new WriteMessageCallback(WriteMessage); this.Invoke(d, new object[] { message }); } else { this.txtUpdateMessages.AppendText(message + Environment.NewLine); } }
/// <summary> /// Routine Summary: /// /// private void WriteCommunicationsMessage(string text); /// /// Description: /// /// Roiutine to write the response to a text box. /// /// If the calling thread is different from the thread that created the /// TextBox control, this method creates a WriteCommunicationsMessageCallback and calls itself /// asynchronously using the Invoke method. /// /// If the calling thread is the same as the thread that created the /// TextBox control, the Text property is set directly. /// /// Return Value: /// /// None. /// /// Modification History: /// /// 8/24/09 JWY - First version of class. /// </summary> private void WriteCommunicationsMessage(string text) { // InvokeRequired required compares the thread ID of the calling thread // to the thread ID of the creating thread. If these threads are // different, it returns true. if (tb_communications.InvokeRequired) { WriteMessageCallback d = new WriteMessageCallback(WriteCommunicationsMessage); Invoke(d, new object[] { text }); } else { // show the text tb_communications.Text += text; // move the horizontal bar to the end of text tb_communications.SelectionStart = tb_communications.TextLength; tb_communications.ScrollToCaret(); } }