Example #1
0
        /// <summary>
        /// Reads the value from the cache.
        /// </summary>
        public ItemValueResult Read(string itemID, string locale, System.Type reqType, int maxAge)
        {
            lock (this)
            {
                if (m_disposed)
                {
                    throw new ObjectDisposedException("Opc.Da.Cache");
                }

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

                CacheItem item = LookupItem(itemID);

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

                return(item.Read(locale, reqType, maxAge, m_supportsCOM));
            }
        }