Ejemplo n.º 1
0
        /// <summary>
        /// Writes a value to the device.
        /// </summary>
        public IdentifiedResult Write(string itemID, string locale, ItemValue value)
        {
            lock (this)
            {
                if (m_disposed)
                {
                    throw new ObjectDisposedException("Opc.Da.Cache");
                }

                if (itemID == null || itemID.Length == 0)
                {
                    return(new IdentifiedResult(itemID, ResultID.Da.E_INVALID_ITEM_NAME));
                }

                CacheItem item = LookupItem(itemID);

                if (item == null)
                {
                    return(new IdentifiedResult(itemID, ResultID.Da.E_UNKNOWN_ITEM_NAME));
                }

                return(item.Write(locale, value, m_supportsCOM));
            }
        }