Esempio n. 1
0
        public object ToObject()
        {
            // Check the simple case upfront
            if (IsEmpty)
            {
                return(null);
            }

            switch (VariantType)
            {
            case VarEnum.VT_NULL: return(DBNull.Value);

                #region Generated Variant ToObject

            // *** BEGIN GENERATED CODE ***
            // generated by function: gen_ToObject from: generate_comdispatch.py

            case VarEnum.VT_I1: return(AsI1);

            case VarEnum.VT_I2: return(AsI2);

            case VarEnum.VT_I4: return(RuntimeOps.Int32ToObject(AsI4));

            case VarEnum.VT_I8: return(AsI8);

            case VarEnum.VT_UI1: return(AsUi1);

            case VarEnum.VT_UI2: return(AsUi2);

            case VarEnum.VT_UI4: return(AsUi4);

            case VarEnum.VT_UI8: return(AsUi8);

            case VarEnum.VT_INT: return(AsInt);

            case VarEnum.VT_UINT: return(AsUint);

            case VarEnum.VT_BOOL: return(AsBool ? RuntimeOps.True : RuntimeOps.False);

            case VarEnum.VT_ERROR: return(AsError);

            case VarEnum.VT_R4: return(AsR4);

            case VarEnum.VT_R8: return(AsR8);

            case VarEnum.VT_DECIMAL: return(AsDecimal);

            case VarEnum.VT_CY: return(AsCy);

            case VarEnum.VT_DATE: return(AsDate);

            case VarEnum.VT_BSTR: return(AsBstr);

            case VarEnum.VT_UNKNOWN: return(AsUnknown);

            case VarEnum.VT_DISPATCH: return(AsDispatch);

            case VarEnum.VT_VARIANT: return(AsVariant);

                // *** END GENERATED CODE ***

                #endregion

            default:
                return(AsVariant);
            }
        }
Esempio n. 2
0
 public static object Int32ToObject(int value)
 {
     return(RuntimeOps.Int32ToObject(value));
 }