コード例 #1
0
        /// <summary>
        /// Completes an asynchronous request cancel
        /// </summary>
        private void OnCancel(object stateInfo)
        {
            try
            {
                lock (this)
                {
                    // check if subscription object has been disposed.
                    if (m_disposed)
                    {
                        return;
                    }
                }

                // unmarshal arguments.
                Opc.Da.Request             request  = null;
                CancelCompleteEventHandler callback = null;

                if (typeof(object[]).IsInstanceOfType(stateInfo))
                {
                    request  = (Opc.Da.Request)((object[])stateInfo)[0];
                    callback = (CancelCompleteEventHandler)((object[])stateInfo)[1];
                }

                // invoke callback.
                callback(request.Handle);
            }
            catch (Exception e)
            {
                string message = e.Message;
            }
        }
コード例 #2
0
        /// <summary>
        /// Cancels an existing request.
        /// </summary>
        public bool CancelRequest(Request request, CancelCompleteEventHandler callback)
        {
            lock (this)
            {
                // check if it is a valid request.
                if (!m_requests.Contains(request.RequestID))
                {
                    return(false);
                }

                // request will be removed when the cancel complete callback arrives.
                if (callback != null)
                {
                    request.CancelComplete += callback;
                }

                // no confirmation required - remove request immediately.
                else
                {
                    m_requests.Remove(request.RequestID);
                }

                // request will be cancelled.
                return(true);
            }
        }
コード例 #3
0
ファイル: Server.cs プロジェクト: ZSYMAX/OpcNetApi
 // Token: 0x06000484 RID: 1156 RVA: 0x0000DB17 File Offset: 0x0000CB17
 public void CancelRequest(IRequest request, CancelCompleteEventHandler callback)
 {
     if (this.m_server == null)
     {
         throw new NotConnectedException();
     }
     ((IServer)this.m_server).CancelRequest(request, callback);
 }
コード例 #4
0
ファイル: DataCallback.cs プロジェクト: simple555a/Solarfist
 public bool CancelRequest(Request request, CancelCompleteEventHandler callback)
 {
     lock (this)
     {
         if (!this.m_requests.Contains(request.RequestID))
         {
             return(false);
         }
         if (callback != null)
         {
             request.CancelComplete += callback;
         }
         else
         {
             this.m_requests.Remove(request.RequestID);
         }
         return(true);
     }
 }
コード例 #5
0
ファイル: Subscription.cs プロジェクト: ZSYMAX/OpcNetApi
 // Token: 0x060004EB RID: 1259 RVA: 0x0000E6CA File Offset: 0x0000D6CA
 public void Cancel(IRequest request, CancelCompleteEventHandler callback)
 {
     this.m_subscription.Cancel(request, callback);
 }
コード例 #6
0
 /// <summary>
 /// Cancels the request, if possible.
 /// </summary>
 public void Cancel(CancelCompleteEventHandler callback) /*OpcGroup.Cancel(this, callback);*/ }
コード例 #7
0
ファイル: Request.cs プロジェクト: simple555a/Solarfist
 public void Cancel(CancelCompleteEventHandler callback)
 {
     this.m_subscription.Cancel(this, callback);
 }
コード例 #8
0
 /// <summary>
 /// Cancels an asynchronous read or write operation.
 /// </summary>
 /// <param name="request">The object returned from the BeginRead or BeginWrite request.</param>
 /// <param name="callback">The function to invoke when the cancel completes.</param>
 public void Cancel(IRequest request, CancelCompleteEventHandler callback)
 {
     throw new NotImplementedException("Cancel");
 }