コード例 #1
0
        internal Dictionary <string, OleDbPropertyInfo> GetValues()
        {
            Dictionary <string, OleDbPropertyInfo> dictionary = null;
            bool success = false;

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                base.DangerousAddRef(ref success);
                if (!(ADP.PtrZero != base.handle))
                {
                    return(dictionary);
                }
                dictionary = new Dictionary <string, OleDbPropertyInfo>(StringComparer.OrdinalIgnoreCase);
                IntPtr           handle         = base.handle;
                tagDBPROPINFO    structure      = new tagDBPROPINFO();
                tagDBPROPINFOSET gdbpropinfoset = new tagDBPROPINFOSET();
                int num2 = 0;
                while (num2 < this.setCount)
                {
                    Marshal.PtrToStructure(handle, gdbpropinfoset);
                    int    cPropertyInfos  = gdbpropinfoset.cPropertyInfos;
                    IntPtr rgPropertyInfos = gdbpropinfoset.rgPropertyInfos;
                    int    num             = 0;
                    while (num < cPropertyInfos)
                    {
                        Marshal.PtrToStructure(rgPropertyInfos, structure);
                        OleDbPropertyInfo info = new OleDbPropertyInfo {
                            _propertySet     = gdbpropinfoset.guidPropertySet,
                            _propertyID      = structure.dwPropertyID,
                            _flags           = structure.dwFlags,
                            _vtype           = structure.vtType,
                            _supportedValues = structure.vValue,
                            _description     = structure.pwszDescription,
                            _lowercase       = structure.pwszDescription.ToLower(CultureInfo.InvariantCulture),
                            _type            = FromVtType(structure.vtType)
                        };
                        if (Bid.AdvancedOn)
                        {
                            Bid.Trace("<oledb.struct.OleDbPropertyInfo|INFO|ADV> \n");
                        }
                        dictionary[info._lowercase] = info;
                        num++;
                        rgPropertyInfos = ADP.IntPtrOffset(rgPropertyInfos, ODB.SizeOf_tagDBPROPINFO);
                    }
                    num2++;
                    handle = ADP.IntPtrOffset(handle, ODB.SizeOf_tagDBPROPINFOSET);
                }
            }
            finally
            {
                if (success)
                {
                    base.DangerousRelease();
                }
            }
            return(dictionary);
        }
コード例 #2
0
        internal Dictionary <string, OleDbPropertyInfo> GetValues()
        {
            Dictionary <string, OleDbPropertyInfo> propertyLookup = null;

            bool mustRelease = false;

            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                DangerousAddRef(ref mustRelease);
                if (ADP.PtrZero != this.handle)
                {
                    propertyLookup = new Dictionary <string, OleDbPropertyInfo>(StringComparer.OrdinalIgnoreCase);

                    IntPtr           setPtr      = this.handle;
                    tagDBPROPINFO    propinfo    = new tagDBPROPINFO();
                    tagDBPROPINFOSET propinfoset = new tagDBPROPINFOSET();

                    for (int i = 0; i < setCount; ++i, setPtr = ADP.IntPtrOffset(setPtr, ODB.SizeOf_tagDBPROPINFOSET))
                    {
                        Marshal.PtrToStructure(setPtr, propinfoset);

                        int    infoCount = propinfoset.cPropertyInfos;
                        IntPtr infoPtr   = propinfoset.rgPropertyInfos;
                        for (int k = 0; k < infoCount; ++k, infoPtr = ADP.IntPtrOffset(infoPtr, ODB.SizeOf_tagDBPROPINFO))
                        {
                            Marshal.PtrToStructure(infoPtr, propinfo);

                            OleDbPropertyInfo propertyInfo = new OleDbPropertyInfo();
                            propertyInfo._propertySet     = propinfoset.guidPropertySet;
                            propertyInfo._propertyID      = propinfo.dwPropertyID;
                            propertyInfo._flags           = propinfo.dwFlags;
                            propertyInfo._vtype           = propinfo.vtType;
                            propertyInfo._supportedValues = propinfo.vValue;
                            propertyInfo._description     = propinfo.pwszDescription;
                            propertyInfo._lowercase       = propinfo.pwszDescription.ToLower(CultureInfo.InvariantCulture);
                            propertyInfo._type            = PropertyInfoSet.FromVtType(propinfo.vtType);

                            if (Bid.AdvancedOn)
                            {
                                Bid.Trace("<oledb.struct.OleDbPropertyInfo|INFO|ADV> \n");//, propertyInfo);
                            }
                            propertyLookup[propertyInfo._lowercase] = propertyInfo;
                        }
                    }
                }
            }
            finally {
                if (mustRelease)
                {
                    DangerousRelease();
                }
            }
            return(propertyLookup);
        }
コード例 #3
0
        internal Dictionary<string,OleDbPropertyInfo> GetValues() {
            Dictionary<string,OleDbPropertyInfo> propertyLookup = null;
            
            bool mustRelease = false;            
            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                DangerousAddRef(ref mustRelease);
                if (ADP.PtrZero != this.handle) {
                    propertyLookup = new Dictionary<string,OleDbPropertyInfo>(StringComparer.OrdinalIgnoreCase);

                    IntPtr setPtr = this.handle;
                    tagDBPROPINFO propinfo = new tagDBPROPINFO();
                    tagDBPROPINFOSET propinfoset = new tagDBPROPINFOSET();

                    for (int i = 0; i < setCount; ++i, setPtr = ADP.IntPtrOffset(setPtr, ODB.SizeOf_tagDBPROPINFOSET)) {
                        Marshal.PtrToStructure(setPtr, propinfoset);

                        int infoCount = propinfoset.cPropertyInfos;
                        IntPtr infoPtr = propinfoset.rgPropertyInfos;
                        for(int k = 0; k < infoCount; ++k, infoPtr = ADP.IntPtrOffset(infoPtr, ODB.SizeOf_tagDBPROPINFO)) {
                            Marshal.PtrToStructure(infoPtr, propinfo);

                            OleDbPropertyInfo propertyInfo = new OleDbPropertyInfo();
                            propertyInfo._propertySet = propinfoset.guidPropertySet;
                            propertyInfo._propertyID = propinfo.dwPropertyID;
                            propertyInfo._flags = propinfo.dwFlags;
                            propertyInfo._vtype = propinfo.vtType;
                            propertyInfo._supportedValues = propinfo.vValue;
                            propertyInfo._description = propinfo.pwszDescription;
                            propertyInfo._lowercase = propinfo.pwszDescription.ToLower(CultureInfo.InvariantCulture);
                            propertyInfo._type = PropertyInfoSet.FromVtType(propinfo.vtType);

                            if (Bid.AdvancedOn) {
                                Bid.Trace("<oledb.struct.OleDbPropertyInfo|INFO|ADV> \n");//, propertyInfo);
                            }
                            propertyLookup[propertyInfo._lowercase] = propertyInfo;
                        }
                    }
                }
            }
            finally {
                if (mustRelease) {
                    DangerousRelease();
                }
            }
            return propertyLookup;
        }
 internal Dictionary<string, OleDbPropertyInfo> GetValues()
 {
     Dictionary<string, OleDbPropertyInfo> dictionary = null;
     bool success = false;
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         base.DangerousAddRef(ref success);
         if (!(ADP.PtrZero != base.handle))
         {
             return dictionary;
         }
         dictionary = new Dictionary<string, OleDbPropertyInfo>(StringComparer.OrdinalIgnoreCase);
         IntPtr handle = base.handle;
         tagDBPROPINFO structure = new tagDBPROPINFO();
         tagDBPROPINFOSET gdbpropinfoset = new tagDBPROPINFOSET();
         int num2 = 0;
         while (num2 < this.setCount)
         {
             Marshal.PtrToStructure(handle, gdbpropinfoset);
             int cPropertyInfos = gdbpropinfoset.cPropertyInfos;
             IntPtr rgPropertyInfos = gdbpropinfoset.rgPropertyInfos;
             int num = 0;
             while (num < cPropertyInfos)
             {
                 Marshal.PtrToStructure(rgPropertyInfos, structure);
                 OleDbPropertyInfo info = new OleDbPropertyInfo {
                     _propertySet = gdbpropinfoset.guidPropertySet,
                     _propertyID = structure.dwPropertyID,
                     _flags = structure.dwFlags,
                     _vtype = structure.vtType,
                     _supportedValues = structure.vValue,
                     _description = structure.pwszDescription,
                     _lowercase = structure.pwszDescription.ToLower(CultureInfo.InvariantCulture),
                     _type = FromVtType(structure.vtType)
                 };
                 if (Bid.AdvancedOn)
                 {
                     Bid.Trace("<oledb.struct.OleDbPropertyInfo|INFO|ADV> \n");
                 }
                 dictionary[info._lowercase] = info;
                 num++;
                 rgPropertyInfos = ADP.IntPtrOffset(rgPropertyInfos, ODB.SizeOf_tagDBPROPINFO);
             }
             num2++;
             handle = ADP.IntPtrOffset(handle, ODB.SizeOf_tagDBPROPINFOSET);
         }
     }
     finally
     {
         if (success)
         {
             base.DangerousRelease();
         }
     }
     return dictionary;
 }