Opc.Ua.AsyncResultBase.OperationCompleted C# (CSharp) Method

OperationCompleted() public method

Called to invoke the callback after the asynchronous operation completes.
public OperationCompleted ( ) : void
return void
        public void OperationCompleted()
        {
            lock (m_lock)
            {
                m_isCompleted = true;

                // signal an waiting threads.
                if (m_waitHandle != null)
                {
                    try
                    {
                        m_waitHandle.Set();
                    }
                    catch (ObjectDisposedException)
                    {
                        // ignore 
                    }
                }
            }

            // invoke callback.
            if (m_callback != null)
            {
                m_callback(this);
            }
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Begins an asynchronous operation to close the secure channel.
        /// </summary>
        public IAsyncResult BeginClose(AsyncCallback callback, object callbackData)
        {
            if (m_wcfBypassChannel != null)
            {
                return m_wcfBypassChannel.BeginClose(callback, callbackData);
            }

            AsyncResultBase result = new AsyncResultBase(callback, callbackData, 0);
            result.OperationCompleted();
            return result;
        }