public void Dispose()
 {
     object o = this._unknown;
     this._unknown = null;
     this._value = null;
     if (o != null)
     {
         Marshal.ReleaseComObject(o);
     }
 }
Пример #2
0
        public void Dispose()
        {
            object unknown = _unknown;

            _unknown = null !;
            _value   = null !;
            if (null != unknown)
            {
                Marshal.ReleaseComObject(unknown);
            }
        }
        public void Dispose()
        {
            object o = this._unknown;

            this._unknown = null;
            this._value   = null;
            if (o != null)
            {
                Marshal.ReleaseComObject(o);
            }
        }
Пример #4
0
        internal PropertyInfoSet(UnsafeNativeMethods.IDBProperties idbProperties, PropertyIDSet propIDSet) : base(IntPtr.Zero, true)
        {
            OleDbHResult hr;
            int          propIDSetCount = propIDSet.Count; // avoid need for ReliabilityContract on get_Count

            Bid.Trace("<oledb.IDBProperties.GetPropertyInfo|API|OLEDB>\n");
            RuntimeHelpers.PrepareConstrainedRegions();
            try {} finally {
                hr = idbProperties.GetPropertyInfo(propIDSetCount, propIDSet, out this.setCount, out base.handle, out this.descBuffer);
            }
            Bid.Trace("<oledb.IDBProperties.GetPropertyInfo|API|OLEDB|RET> %08X{HRESULT}\n", hr);
            if ((0 <= hr) && (ADP.PtrZero != handle))
            {
                SafeNativeMethods.Wrapper.ClearErrorInfo();
            }
        }
Пример #5
0
        internal DBPropSet(UnsafeNativeMethods.IDBProperties properties, PropertyIDSet propidset, out OleDbHResult hr) : this()
        {
            int cPropertyIDSets = 0;

            if (propidset != null)
            {
                cPropertyIDSets = propidset.Count;
            }
            Bid.Trace("<oledb.IDBProperties.GetProperties|API|OLEDB>\n");
            hr = properties.GetProperties(cPropertyIDSets, propidset, out this.propertySetCount, out this.handle);
            Bid.Trace("<oledb.IDBProperties.GetProperties|API|OLEDB|RET> %08X{HRESULT}\n", hr);
            if (hr < OleDbHResult.S_OK)
            {
                this.SetLastErrorInfo(hr);
            }
        }
Пример #6
0
        internal PropertyInfoSet(UnsafeNativeMethods.IDBProperties idbProperties, PropertyIDSet propIDSet) : base(IntPtr.Zero, true)
        {
            OleDbHResult hr;
            int          propIDSetCount = propIDSet.Count;

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            { }
            finally
            {
                hr = idbProperties.GetPropertyInfo(propIDSetCount, propIDSet, out this.setCount, out base.handle, out this.descBuffer);
            }
            if ((0 <= hr) && (ADP.PtrZero != handle))
            {
                SafeNativeMethods.Wrapper.ClearErrorInfo();
            }
        }
Пример #7
0
        internal DBPropSet(UnsafeNativeMethods.IDBProperties properties, PropertyIDSet propidset, out OleDbHResult hr) : this()
        {
            Debug.Assert(null != properties, "null IDBProperties");

            int propidsetcount = 0;

            if (null != propidset)
            {
                propidsetcount = propidset.Count;
            }
            hr = properties.GetProperties(propidsetcount, propidset, out this.propertySetCount, out base.handle);

            if (hr < 0)
            {
                // remember the last HRESULT. Note we do not want to raise exception now to avoid breaking change from Orcas RTM/SP1
                SetLastErrorInfo(hr);
            }
        }
        internal PropertyInfoSet(UnsafeNativeMethods.IDBProperties idbProperties, PropertyIDSet propIDSet) : base(IntPtr.Zero, true)
        {
            OleDbHResult result;
            int          count = propIDSet.Count;

            Bid.Trace("<oledb.IDBProperties.GetPropertyInfo|API|OLEDB>\n");
            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
            }
            finally
            {
                result = idbProperties.GetPropertyInfo(count, propIDSet, out this.setCount, out this.handle, out this.descBuffer);
            }
            Bid.Trace("<oledb.IDBProperties.GetPropertyInfo|API|OLEDB|RET> %08X{HRESULT}\n", result);
            if ((OleDbHResult.S_OK <= result) && (ADP.PtrZero != base.handle))
            {
                SafeNativeMethods.Wrapper.ClearErrorInfo();
            }
        }
Пример #9
0
 internal IDBPropertiesWrapper(object unknown)
 {
     _unknown = unknown;
     _value   = (unknown as UnsafeNativeMethods.IDBProperties) !;
     Debug.Assert(null != _value, "null IDBProperties");
 }
Пример #10
0
 public void Dispose() {
     object unknown = _unknown;
     _unknown = null;
     _value = null;
     if (null != unknown) {
         Marshal.ReleaseComObject(unknown);
     }
 }
Пример #11
0
 internal IDBPropertiesWrapper(object unknown) {
     _unknown = unknown;
     _value = (unknown as UnsafeNativeMethods.IDBProperties);
     Debug.Assert(null != _value, "null IDBProperties");
 }
 internal IDBPropertiesWrapper(object unknown)
 {
     this._unknown = unknown;
     this._value = unknown as UnsafeNativeMethods.IDBProperties;
 }
 internal IDBPropertiesWrapper(object unknown)
 {
     this._unknown = unknown;
     this._value   = unknown as UnsafeNativeMethods.IDBProperties;
 }