Пример #1
0
        public override string ToString()
        {
            var firstprop = LiveProperties.FirstOrDefault();

            if (firstprop != null)
            {
                return(string.Format("[Valve: Path={0}, Values={1}]", firstprop.Path, string.Join(",", LiveProperties.Select(p => p.Value).Distinct())));
            }
            else
            {
                return("[Valve: Path=(none), Value=(none)]");
            }
        }
Пример #2
0
        public bool Activate(object toActivate)
        {
            if (toActivate == null)
            {
                return(false);
            }
            var prop = LiveProperties.FirstOrDefault(p => ReferenceEquals(toActivate, p.Object));

            if (prop != null)
            {
                var value = prop.Value;
                Push(prop, value);
                OnValueChanged(prop, value);
                return(true);
            }
            return(false);
        }