예제 #1
0
 public CimOperationOptions(bool mustUnderstand)
 {
     this._operationCallback     = new OperationCallbacks();
     this._writeMessageCallback  = null;
     this._writeProgressCallback = null;
     this._writeErrorCallback    = null;
     this._promptUserCallback    = null;
 }
예제 #2
0
 public CimOperationOptions(bool mustUnderstand)
 {
     this._operationCallback = new OperationCallbacks();
     this._writeMessageCallback = null;
     this._writeProgressCallback = null;
     this._writeErrorCallback = null;
     this._promptUserCallback = null;
 }
예제 #3
0
 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;
 }
예제 #4
0
 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;
 }
예제 #5
0
 /// <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);
     }
 }
예제 #6
0
        /// <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();
             }
        }