コード例 #1
0
 internal static extern HRESULT PropVariantGetStringElem(
     [In] ref PropVariant propVar,
     [In] uint iElem,
     [Out][MarshalAs(UnmanagedType.LPWStr)] out string ppszVal);
コード例 #2
0
 internal static extern HRESULT PropVariantGetFileTimeElem(
     [In] PropVariant propVar,
     [In] uint iElem,
     [Out][MarshalAs(UnmanagedType.Struct)] out FILETIME pftVal);
コード例 #3
0
 internal static extern HRESULT PropVariantGetInt32Elem(
     [In] PropVariant propVar,
     [In] uint iElem,
     [Out] out Int32 pnVal);
コード例 #4
0
 internal static extern HRESULT InitPropVariantFromInt16Vector(
     [In] Int16[] prgn,
     uint cElems,
     [Out] out PropVariant ppropvar);
コード例 #5
0
 internal static extern HRESULT InitPropVariantFromResource(
     [In] IntPtr hinst,
     uint id,
     [Out] out PropVariant ppropvar);
コード例 #6
0
 internal static extern HRESULT InitPropVariantFromBuffer(
     [In] byte[] pv,
     uint cb,
     [Out] out PropVariant ppropvar);
コード例 #7
0
 internal static extern HRESULT InitPropVariantFromFileTime(
     [In] ref FILETIME pftIn,
     [Out] out PropVariant ppropvar);
コード例 #8
0
 internal static extern HRESULT PropVariantChangeType(
     [Out] out PropVariant ppropvarDest,
     [In] ref PropVariant propvarSrc,
     [In] int flags,
     [In] ushort vt);
コード例 #9
0
 internal static extern HRESULT PropVariantClear([In] ref PropVariant pvar);
コード例 #10
0
 internal static extern HRESULT FreePropVariantArray(uint cVariants, [In][Out] ref PropVariant rgvars);
コード例 #11
0
 internal static extern HRESULT InitPropVariantVectorFromPropVariant(
     [In] ref PropVariant propvarSingle,
     [Out] out PropVariant[] propvarVector);
コード例 #12
0
 internal static extern HRESULT InitPropVariantFromStringVector(
     [In] string[] prgsz,
     uint cElems,
     [Out] out PropVariant ppropvar);
コード例 #13
0
 internal static extern HRESULT InitPropVariantFromStringAsVector(
     [In] string psz,
     [Out] out PropVariant ppropvar);
コード例 #14
0
 internal static extern void ClearPropVariantArray([In] ref PropVariant rgPropVar, uint vVars);
コード例 #15
0
 internal static extern HRESULT PropVariantGetUInt64Elem(
     [In] PropVariant propVar,
     [In] uint iElem,
     [Out] out UInt64 pnVal);
コード例 #16
0
 internal static extern HRESULT PropVariantCopy([Out] out PropVariant pDst, [In] ref PropVariant pSrc);
コード例 #17
0
 internal static extern HRESULT InitPropVariantFromBooleanVector(
     [In] bool[] prgf,
     uint cElems,
     [Out] out PropVariant ppropvar);
コード例 #18
0
 internal static extern HRESULT PropVariantGetBooleanElem(
     [In] PropVariant propVar,
     [In] uint iElem,
     [Out][MarshalAs(UnmanagedType.Bool)] out bool pfVal);
コード例 #19
0
 internal static extern HRESULT InitPropVariantFromDoubleVector(
     [In] double[] prgn,
     uint cElems,
     [Out] out PropVariant ppropvar);
コード例 #20
0
 internal static extern HRESULT PropVariantGetDoubleElem(
     [In] PropVariant propVar,
     [In] uint iElem,
     [Out] out double pnVal);
コード例 #21
0
 internal static extern HRESULT InitPropVariantFromFileTimeVector(
     [In] FILETIME[] prgft,
     uint cElems,
     [Out] out PropVariant ppropvar);
コード例 #22
0
 internal static extern int PropVariantGetElementCount([In] PropVariant propVar);
コード例 #23
0
        /// <summary>
        ///     指定した<paramref name="value" />から<see cref="PropVariant" />を作成します。
        ///     Create a new instance of the <see cref="PropVariant" /> struct
        ///     to the specified <see cref="object" />.
        /// </summary>
        /// <param name="value">オブジェクト。</param>
        /// <returns>作成した<see cref="PropVariant" />。</returns>
        public static PropVariant FromObject(object value)
        {
            if (value == null)
            {
                var result = new PropVariant();
                result.varType = (ushort)VarEnum.VT_EMPTY;
                return(result);
            }
            else
            {
                #region Create Value

                if (value is string)
                {
                    return(FromString((string)value));
                }
                else if (value is string[])
                {
                    return(FromStringArray((string[])value));
                }
                else if (value is sbyte)
                {
                    return(FromInt8((sbyte)value));
                }
                else if (value is byte)
                {
                    return(FromUInt8((byte)value));
                }
                else if (value is Int16)
                {
                    return(FromInt16((Int16)value));
                }
                else if (value is UInt16)
                {
                    return(FromUInt16((UInt16)value));
                }
                else if (value is Int32)
                {
                    return(FromInt32((Int32)value));
                }
                else if (value is UInt32)
                {
                    return(FromUInt32((UInt32)value));
                }
                else if (value is Int64)
                {
                    return(FromInt64((Int64)value));
                }
                else if (value is UInt64)
                {
                    return(FromUInt64((UInt64)value));
                }
                else if (value is float)
                {
                    return(FromSingle((float)value));
                }
                else if (value is double)
                {
                    return(FromDouble((double)value));
                }
                else if (value is bool)
                {
                    return(FromBoolean((bool)value));
                }
                else if (value is Guid)
                {
                    return(FromGuid((Guid)value));
                }

                #endregion
            }

            throw new InvalidOperationException();
        }
コード例 #24
0
 internal static extern HRESULT InitPropVariantFromPropVariantVectorElem(
     [In] ref PropVariant propvarIn,
     uint iElem,
     [Out] out PropVariant ppropvar);