Example #1
0
        /// <inheritdoc />
        public override void Set(object instance, IMoValue value)
        {
            var propType = _propertyInfo.PropertyType;

            if (propType == typeof(double))
            {
                _propertyInfo.SetValue(instance, value.AsDouble());
                return;
            }
            else if (propType == typeof(float))
            {
                _propertyInfo.SetValue(instance, value.AsFloat());
                return;
            }
            else if (propType == typeof(bool))
            {
                _propertyInfo.SetValue(instance, value.AsBool());
                return;
            }
            else if (propType == typeof(string))
            {
                _propertyInfo.SetValue(instance, value.AsString());
                return;
            }

            _propertyInfo.SetValue(instance, value);
            InvokeChanged();
        }
Example #2
0
        /// <inheritdoc />
        public bool Equals(IMoValue b)
        {
            if (_value == b.AsDouble())
            {
                return(true);
            }

            return(false);
        }