Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //[....] //[....] //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SoapMessage.cs
- SocketAddress.cs
- GeometryHitTestParameters.cs
- XmlDataImplementation.cs
- DataContractJsonSerializer.cs
- SystemFonts.cs
- RadioButtonList.cs
- RegisteredExpandoAttribute.cs
- ValidationHelpers.cs
- ButtonBaseDesigner.cs
- CoreSwitches.cs
- DataGridViewRowPrePaintEventArgs.cs
- ProcessThreadCollection.cs
- SystemTcpConnection.cs
- DbMetaDataFactory.cs
- HttpsTransportElement.cs
- InkCanvasInnerCanvas.cs
- PathFigureCollection.cs
- WasEndpointConfigContainer.cs
- BoundPropertyEntry.cs
- SqlParameter.cs
- UIElementIsland.cs
- Int64KeyFrameCollection.cs
- EditorPart.cs
- SafeEventLogWriteHandle.cs
- NotImplementedException.cs
- DesignerActionVerbList.cs
- NamedPermissionSet.cs
- FixedFindEngine.cs
- SqlGenericUtil.cs
- IncrementalHitTester.cs
- PackagingUtilities.cs
- ServiceHostingEnvironment.cs
- OperatingSystem.cs
- OlePropertyStructs.cs
- EntityConnectionStringBuilder.cs
- DocumentGridContextMenu.cs
- XmlResolver.cs
- MaskedTextBoxTextEditorDropDown.cs
- DataRowIndexBuffer.cs
- CriticalExceptions.cs
- HttpHostedTransportConfiguration.cs
- DecimalStorage.cs
- Configuration.cs
- TraceLevelStore.cs
- DrawToolTipEventArgs.cs
- LiteralControl.cs
- PrintPreviewDialog.cs
- SiteMembershipCondition.cs
- ClientProxyGenerator.cs
- HttpSessionStateWrapper.cs
- FormsAuthenticationConfiguration.cs
- FigureParagraph.cs
- HtmlMeta.cs
- PointCollection.cs
- CustomErrorCollection.cs
- QilFactory.cs
- TextSimpleMarkerProperties.cs
- XmlILTrace.cs
- GetPageNumberCompletedEventArgs.cs
- IPipelineRuntime.cs
- RequestUriProcessor.cs
- Rect.cs
- ValidatingPropertiesEventArgs.cs
- SetMemberBinder.cs
- SafeLocalAllocation.cs
- BamlReader.cs
- RelatedEnd.cs
- ContentElement.cs
- EntityProviderFactory.cs
- ExecutedRoutedEventArgs.cs
- AttachedAnnotation.cs
- SoapDocumentMethodAttribute.cs
- DecryptedHeader.cs
- ComponentDispatcherThread.cs
- securitymgrsite.cs
- StoreItemCollection.Loader.cs
- XmlSchemaProviderAttribute.cs
- KeyGestureConverter.cs
- DbProviderServices.cs
- PerfService.cs
- CodeSubDirectory.cs
- WebPartUtil.cs
- AssemblyAttributesGoHere.cs
- SafeNativeMethods.cs
- ParameterCollection.cs
- ManualResetEvent.cs
- DirectionalLight.cs
- BuildProviderUtils.cs
- DetailsViewPagerRow.cs
- QilCloneVisitor.cs
- DebugView.cs
- WebPartDisplayModeEventArgs.cs
- VariableQuery.cs
- MonikerUtility.cs
- WebPartCatalogCloseVerb.cs
- RouteCollection.cs
- PermissionAttributes.cs
- GlobalProxySelection.cs
- XNodeValidator.cs