Exemplo n.º 1
0
        /// <summary>
        /// Initializes the object with its item id and device.
        /// </summary>
        //public SubscriptionItem(string itemID, Cache cache)//zgodnie z kodem dostarczonym z serwerem i NETApi2
        public SubscriptionItem(string itemID, ICacheServer cache)
        {
            if (itemID == null)
            {
                throw new ArgumentNullException("itemID");
            }
            if (cache == null)
            {
                throw new ArgumentNullException("cache");
            }

            m_itemID = itemID;
            m_cache  = cache;

            m_euType = (euType)m_cache.ReadProperty(m_itemID, Property.EUTYPE);

            if (m_euType == euType.analog)
            {
                m_maxValue = (double)m_cache.ReadProperty(m_itemID, Property.HIGHEU);
                m_minValue = (double)m_cache.ReadProperty(m_itemID, Property.LOWEU);
            }
        }