Example #1
0
        public override void unpack(TTypedValue src)
        {
            DDMLValue.setValue(src);
            setPropertyValue(); //store the Value property
            T Data = Value;

            Property.SetObject(Data);
        }
Example #2
0
        private void setValue(object value)
        {
            tType = typeof(T);
            Value = (T)Convert.ChangeType(value, tType);

            if (tType == typeof(Boolean))
            {
                DDMLValue.setValue(Convert.ToBoolean(value));
            }
            else if (tType == typeof(Int32))
            {
                DDMLValue.setValue(Convert.ToInt32(value));
            }
            else if (tType == typeof(Single))
            {
                DDMLValue.setValue(Convert.ToSingle(value));
            }
            else if (tType == typeof(double))
            {
                DDMLValue.setValue(Convert.ToDouble(value));
            }
            else if (tType == typeof(String))
            {
                DDMLValue.setValue(Convert.ToString(value));
            }
            else if (tType == typeof(Boolean[]))
            {
                DDMLValue.setValue((Boolean[])Convert.ChangeType(value, tType));
            }
            else if (tType == typeof(Int32[]))
            {
                DDMLValue.setValue((Int32[])Convert.ChangeType(value, tType));
            }
            else if (tType == typeof(Single[]))
            {
                DDMLValue.setValue((Single[])Convert.ChangeType(value, tType));
            }
            else if (tType == typeof(Double[]))
            {
                DDMLValue.setValue((Double[])Convert.ChangeType(value, tType));
            }
            else if (tType == typeof(String[]))
            {
                DDMLValue.setValue((String[])Convert.ChangeType(value, tType));
            }
            else if (tType == typeof(DateTime))
            {
                double JulianDate = DateUtility.DateTimeToJulianDayNumber((DateTime)Convert.ChangeType(value, tType));
                DDMLValue.setValue(JulianDate);
            }
        }
Example #3
0
 public override void unpack(TTypedValue src)
 {
     DDMLValue.setValue(src);
     setVariableValue();
 }