Пример #1
0
        /// <summary>
        /// Invokes callback for a read annotations request.
        /// </summary>
        private bool InvokeCallback(UpdateCompleteEventHandler callback, object results)
        {
            // check for valid result type.
            if (!typeof(ResultCollection[]).IsInstanceOfType(results))
            {
                return(false);
            }

            ResultCollection[] values = (ResultCollection[])results;

            // update item handles and actual times.
            UpdateResults(values);

            try
            {
                callback(this, values);
            }
            catch
            {
                // ignore exceptions in the callbacks.
            }

            // request always completes
            return(true);
        }
Пример #2
0
 /// <summary>
 /// Starts an asynchronous delete values at specific times request for all items in the trend.
 /// </summary>
 public IdentifiedResult[] DeleteAtTime(
     object requestHandle,
     UpdateCompleteEventHandler callback,
     out IRequest request)
 {
     return(DeleteAtTime(GetItems(), requestHandle, callback, out request));
 }
Пример #3
0
 public IdentifiedResult[] DeleteAtTime(Item[] items, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request)
 {
     ItemTimeCollection[] timesArray = new ItemTimeCollection[items.Length];
     for (int i = 0; i < items.Length; i++)
     {
         timesArray[i]              = (ItemTimeCollection)this.Timestamps.Clone();
         timesArray[i].ItemName     = items[i].ItemName;
         timesArray[i].ItemPath     = items[i].ItemPath;
         timesArray[i].ClientHandle = items[i].ClientHandle;
         timesArray[i].ServerHandle = items[i].ServerHandle;
     }
     return(this.m_server.DeleteAtTime(timesArray, requestHandle, callback, out request));
 }
Пример #4
0
        /// <summary>
        /// Starts an asynchronous delete raw request for a set of items.
        /// </summary>
        public IdentifiedResult[] Delete(
            ItemIdentifier[]           items,
            object requestHandle,
            UpdateCompleteEventHandler callback,
            out IRequest request)
        {
            IdentifiedResult[] results = m_server.Delete(
                StartTime,
                EndTime,
                items,
                requestHandle,
                callback,
                out request);

            return(results);
        }
Пример #5
0
 private bool InvokeCallback(UpdateCompleteEventHandler callback, object results)
 {
     if (!typeof(ResultCollection[]).IsInstanceOfType(results))
     {
         return(false);
     }
     ResultCollection[] resultsArray = (ResultCollection[])results;
     this.UpdateResults(resultsArray);
     try
     {
         callback(this, resultsArray);
     }
     catch
     {
     }
     return(true);
 }
Пример #6
0
        /// <summary>
        /// Sends an asynchronous request to replace values for one or more items.
        /// </summary>
        /// <param name="items">The set of values to replace.</param>
        /// <param name="requestHandle">An identifier for the request assigned by the caller.</param>
        /// <param name="callback">A delegate used to receive notifications when the request completes.</param>
        /// <param name="request">An object that contains the state of the request (used to cancel the request).</param>
        /// <returns>A set of results containing any errors encountered when the server validated the items.</returns>
        public IdentifiedResult[] Replace(
            ItemValueCollection[]      items,
            object requestHandle,
            UpdateCompleteEventHandler callback,
            out IRequest request)
        {
            if (m_server == null)
            {
                throw new NotConnectedException();
            }

            IdentifiedResult[] results = ((IServer)m_server).Replace(
                items,
                requestHandle,
                callback,
                out request);

            return(results);
        }
Пример #7
0
        /// <summary>
        /// Sends an asynchronous request to delete values for one or more items.
        /// </summary>
        /// <param name="startTime">The beginning of the history period to delete.</param>
        /// <param name="endTime">The end of the history period to be delete.</param>
        /// <param name="items">The set of items to delete (must include the server handle).</param>
        /// <param name="requestHandle">An identifier for the request assigned by the caller.</param>
        /// <param name="callback">A delegate used to receive notifications when the request completes.</param>
        /// <param name="request">An object that contains the state of the request (used to cancel the request).</param>
        /// <returns>A set of results containing any errors encountered when the server validated the items.</returns>
        public IdentifiedResult[] Delete(
            Time startTime,
            Time endTime,
            ItemIdentifier[]           items,
            object requestHandle,
            UpdateCompleteEventHandler callback,
            out IRequest request)
        {
            if (m_server == null)
            {
                throw new NotConnectedException();
            }

            IdentifiedResult[] results = ((IServer)m_server).Delete(
                startTime,
                endTime,
                items,
                requestHandle,
                callback,
                out request);

            return(results);
        }
Пример #8
0
 public IdentifiedResult[] Delete(ItemIdentifier[] items, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request)
 {
     return(this.m_server.Delete(this.StartTime, this.EndTime, items, requestHandle, callback, out request));
 }
Пример #9
0
 // Token: 0x06000482 RID: 1154 RVA: 0x0000DAC4 File Offset: 0x0000CAC4
 public IdentifiedResult[] DeleteAtTime(ItemTimeCollection[] items, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request)
 {
     if (this.m_server == null)
     {
         throw new NotConnectedException();
     }
     return(((IServer)this.m_server).DeleteAtTime(items, requestHandle, callback, out request));
 }
Пример #10
0
 // Token: 0x0600047C RID: 1148 RVA: 0x0000D9BC File Offset: 0x0000C9BC
 public IdentifiedResult[] Insert(ItemValueCollection[] items, bool replace, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request)
 {
     if (this.m_server == null)
     {
         throw new NotConnectedException();
     }
     return(((IServer)this.m_server).Insert(items, replace, requestHandle, callback, out request));
 }
Пример #11
0
 public IdentifiedResult[] Replace(ItemValueCollection[] items, object requestHandle, UpdateCompleteEventHandler callback, out IRequest request)
 {
     if (base.m_server == null)
     {
         throw new NotConnectedException();
     }
     return(((Opc.Hda.IServer)base.m_server).Replace(items, requestHandle, callback, out request));
 }