Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Data / System / Data / OleDb / PropertyIDSet.cs / 1 / PropertyIDSet.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; namespace System.Data.OleDb { internal sealed class PropertyIDSet : DbBuffer { static private readonly int PropertyIDSetAndValueSize = ODB.SizeOf_tagDBPROPIDSET + ADP.PtrSize; // sizeof(tagDBPROPIDSET) + sizeof(int) static private readonly int PropertyIDSetSize = ODB.SizeOf_tagDBPROPIDSET; private int _count; // the PropertyID is stored at the end of the tagDBPROPIDSET structure // this way only a single memory allocation is required instead of two internal PropertyIDSet(Guid propertySet, int propertyID) : base(PropertyIDSetAndValueSize) { _count = 1; // rgPropertyIDs references where that PropertyID is stored // depending on IntPtr.Size, tagDBPROPIDSET is either 24 or 28 bytes long IntPtr ptr = ADP.IntPtrOffset(base.handle, PropertyIDSetSize); Marshal.WriteIntPtr(base.handle, 0, ptr); Marshal.WriteInt32(base.handle, ADP.PtrSize, /*propertyid count*/1); ptr = ADP.IntPtrOffset(base.handle, ODB.OffsetOf_tagDBPROPIDSET_PropertySet); Marshal.StructureToPtr(propertySet, ptr, false/*deleteold*/); // write the propertyID at the same offset Marshal.WriteInt32(base.handle, PropertyIDSetSize, propertyID); } // no propertyIDs, just the propertyset guids internal PropertyIDSet(Guid[] propertySets) : base(PropertyIDSetSize * propertySets.Length) { _count = propertySets.Length; for(int i = 0; i < propertySets.Length; ++i) { IntPtr ptr = ADP.IntPtrOffset(base.handle, (i * PropertyIDSetSize) + ODB.OffsetOf_tagDBPROPIDSET_PropertySet); Marshal.StructureToPtr(propertySets[i], ptr, false/*deleteold*/); } } internal int Count { get { return _count; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SQLMoney.cs
- WindowsFormsHelpers.cs
- TCEAdapterGenerator.cs
- Int64.cs
- _HeaderInfoTable.cs
- SQLDecimal.cs
- BuildProviderCollection.cs
- OciLobLocator.cs
- Camera.cs
- Mutex.cs
- IncrementalReadDecoders.cs
- Win32MouseDevice.cs
- ClassImporter.cs
- DeferredElementTreeState.cs
- DoubleIndependentAnimationStorage.cs
- FontFamily.cs
- ToolboxItemImageConverter.cs
- ParseNumbers.cs
- DateTimeFormatInfo.cs
- SmtpFailedRecipientException.cs
- SerializationStore.cs
- DataGridColumnFloatingHeader.cs
- TargetParameterCountException.cs
- SurrogateEncoder.cs
- InputScopeConverter.cs
- HostExecutionContextManager.cs
- XmlSerializerVersionAttribute.cs
- X509CertificateTrustedIssuerElementCollection.cs
- AnnotationService.cs
- HelpKeywordAttribute.cs
- InfoCardMetadataExchangeClient.cs
- GridSplitter.cs
- RepeaterItem.cs
- NullableConverter.cs
- Action.cs
- CompositeActivityMarkupSerializer.cs
- ResponseStream.cs
- SafeSystemMetrics.cs
- _ConnectStream.cs
- ContextBase.cs
- HitTestFilterBehavior.cs
- PrinterResolution.cs
- CultureTable.cs
- WebContext.cs
- InputScope.cs
- TypeTypeConverter.cs
- EnterpriseServicesHelper.cs
- CompilationUnit.cs
- CodeMemberProperty.cs
- _HeaderInfoTable.cs
- LineServices.cs
- OrderablePartitioner.cs
- DataViewSettingCollection.cs
- DisplayInformation.cs
- SslStream.cs
- TrackingMemoryStream.cs
- HtmlSelect.cs
- Triplet.cs
- DataViewManagerListItemTypeDescriptor.cs
- OverlappedAsyncResult.cs
- DecimalAnimationUsingKeyFrames.cs
- _StreamFramer.cs
- DataMember.cs
- DnsPermission.cs
- TargetInvocationException.cs
- Cursors.cs
- Size.cs
- SQLByteStorage.cs
- ControlPaint.cs
- ListBoxAutomationPeer.cs
- DesigntimeLicenseContext.cs
- FontUnitConverter.cs
- LinqDataSourceUpdateEventArgs.cs
- EncodingNLS.cs
- SecurityCriticalDataForSet.cs
- UndirectedGraph.cs
- NativeMethodsCLR.cs
- LicenseContext.cs
- Style.cs
- FixedTextView.cs
- PathGeometry.cs
- TaskFormBase.cs
- TraceHandlerErrorFormatter.cs
- ToolStripDropDownButton.cs
- DesignerRegion.cs
- ConfigXmlSignificantWhitespace.cs
- streamingZipPartStream.cs
- XmlDictionaryString.cs
- Types.cs
- Soap.cs
- CurrencyWrapper.cs
- ProfileEventArgs.cs
- ControlValuePropertyAttribute.cs
- SimpleTypeResolver.cs
- Hex.cs
- Overlapped.cs
- CharAnimationBase.cs
- EntityCodeGenerator.cs
- ReturnType.cs
- SecurityTokenSerializer.cs