/// <summary>
        /// Sends an asynchronous request to read the attributes of an item.
        /// </summary>
        /// <param name="startTime">The beginning of the history period to read.</param>
        /// <param name="endTime">The end of the history period to be read.</param>
        /// <param name="item">The item to read (must include the item name).</param>
        /// <param name="attributeIDs">The attributes to read.</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 attribute ids.</returns>
        internal TsCHdaResultCollection ReadAttributes(
            TsCHdaTime startTime,
            TsCHdaTime endTime,
            OpcItem item,
            int[] attributeIDs,
            object requestHandle,
            TsCHdaReadAttributesCompleteEventHandler callback,
            out IOpcRequest request)
        {
            LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.HistoricalAccess);
            if (Server == null)
            {
                throw new NotConnectedException();
            }
            TsCHdaResultCollection results = ((ITsCHdaServer)Server).ReadAttributes(
                startTime,
                endTime,
                item,
                attributeIDs,
                requestHandle,
                callback,
                out request);

            return(results);
        }
        /// <summary>
        /// Initializes object with the specified ResultCollection object.
        /// </summary>
        public TsCHdaResultCollection(TsCHdaResultCollection item)
            : base(item)
        {
            _results = new ArrayList(item._results.Count);

            foreach (TsCHdaResult value in item._results)
            {
                _results.Add(value.Clone());
            }
        }
        ///////////////////////////////////////////////////////////////////////
        #region ICloneable Members

        /// <summary>
        /// Creates a deep copy of the object.
        /// </summary>
        public override object Clone()
        {
            TsCHdaResultCollection collection = (TsCHdaResultCollection)base.Clone();

            collection._results = new ArrayList(_results.Count);

            foreach (TsCHdaResultCollection value in _results)
            {
                collection._results.Add(value.Clone());
            }

            return(collection);
        }
        /// <summary>
        /// Starts an asynchronous read attributes at specific times request for an item.
        /// </summary>
        public TsCHdaResultCollection ReadAttributes(
            OpcItem item,
            int[] attributeIDs,
            object requestHandle,
            TsCHdaReadAttributesCompleteEventHandler callback,
            out IOpcRequest request)
        {
            TsCHdaResultCollection results = _server.ReadAttributes(
                StartTime,
                EndTime,
                item,
                attributeIDs,
                requestHandle,
                callback,
                out request);

            return(results);
        }
Example #5
0
        /// <summary>
        /// Sends an asynchronous request to read the attributes of an item.
        /// </summary>
        /// <param name="startTime">The beginning of the history period to read.</param>
        /// <param name="endTime">The end of the history period to be read.</param>
        /// <param name="item">The item to read (must include the item name).</param>
        /// <param name="attributeIDs">The attributes to read.</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 attribute ids.</returns>
        internal TsCHdaResultCollection ReadAttributes(
            TsCHdaTime startTime,
            TsCHdaTime endTime,
            OpcItem item,
            int[] attributeIDs,
            object requestHandle,
            TsCHdaReadAttributesCompleteEventHandler callback,
            out IOpcRequest request)
        {
            if (_server == null)
            {
                throw new NotConnectedException();
            }
            TsCHdaResultCollection results = ((ITsCHdaServer)_server).ReadAttributes(
                startTime,
                endTime,
                item,
                attributeIDs,
                requestHandle,
                callback,
                out request);

            return(results);
        }