Exemplo n.º 1
0
        internal RangeDataState GetDataState(DataAttributes data)
        {
            if (inRangeTable.ContainsKey(data))
            {
                return((RangeDataState)inRangeTable[data]);
            }
            RangeDataState rangeDataState = new RangeDataState(this, data);

            inRangeTable.Add(data, rangeDataState);
            return(rangeDataState);
        }
Exemplo n.º 2
0
        internal virtual void PointerValueChanged(DataAttributes data)
        {
            double num  = Math.Min(startValue, endValue);
            double num2 = Math.Max(startValue, endValue);

            if (Common == null)
            {
                return;
            }
            bool playbackMode = false;

            if (((IValueConsumer)data).GetProvider() != null)
            {
                playbackMode = ((IValueConsumer)data).GetProvider().GetPlayBackMode();
            }
            NamedElement   pointer   = (NamedElement)data.Parent;
            RangeDataState dataState = GetDataState(data);
            double         num3      = data.Value;

            if (data.IsPercentBased)
            {
                num3 = data.GetValueInPercents();
            }
            if (!dataState.IsInRange && num3 >= num && num3 <= num2)
            {
                dataState.IsInRange = true;
                OnValueRangeEnter(this, new ValueRangeEventArgs(num3, data.DateValueStamp, Name, playbackMode, pointer));
                if (!(inRangeTimeout > 0.0))
                {
                    dataState.IsTimerExceed = true;
                }
            }
            if (dataState.IsInRange && (double.IsNaN(num3) || num3 < num || num3 > num2))
            {
                dataState.IsInRange     = false;
                dataState.IsTimerExceed = false;
                OnValueRangeLeave(this, new ValueRangeEventArgs(num3, data.DateValueStamp, Name, playbackMode, pointer));
                _ = inRangeTimeout;
                _ = 0.0;
            }
        }