Beispiel #1
0
        public static QiValue ToType(AnyValue value, Type targetType)
        {
            if (targetType == typeof(QiValue))
            {
                return(value);
            }

            if (targetType == typeof(StringValue))
            {
                return(new StringValue(value.Handle));
            }

            //var type = targetType.MakeGenericType(new Type[]{ typeof(IntPtr)});
            return((AnyValue)Activator.CreateInstance(targetType, value.Handle));

            throw new InvalidCastException();
        }
Beispiel #2
0
 public AnyValue(AnyValue valCopy) : base(valCopy)
 {
 }