Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / OleDb / PropertyIDSet.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BindMarkupExtensionSerializer.cs
- DatatypeImplementation.cs
- XmlTextReaderImpl.cs
- CommunicationObjectFaultedException.cs
- ConstantExpression.cs
- DynamicActionMessageFilter.cs
- PathFigureCollectionValueSerializer.cs
- DataGridViewColumnStateChangedEventArgs.cs
- PrivilegeNotHeldException.cs
- Int16KeyFrameCollection.cs
- NumericUpDownAccelerationCollection.cs
- AuthStoreRoleProvider.cs
- FixedTextPointer.cs
- NativeMethods.cs
- PeerTransportBindingElement.cs
- StateMachineWorkflowDesigner.cs
- MailAddressCollection.cs
- BasicCellRelation.cs
- ComponentRenameEvent.cs
- InputScopeManager.cs
- TdsParserSafeHandles.cs
- XmlWrappingWriter.cs
- UnSafeCharBuffer.cs
- FlowLayoutPanel.cs
- SqlTransaction.cs
- TraceRecord.cs
- GridViewUpdateEventArgs.cs
- WaitHandleCannotBeOpenedException.cs
- BuildTopDownAttribute.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- ImageListDesigner.cs
- XmlAnyElementAttributes.cs
- StringResourceManager.cs
- PointConverter.cs
- CodeTypeParameter.cs
- ToolStripItemImageRenderEventArgs.cs
- WebColorConverter.cs
- EncoderNLS.cs
- RemotingException.cs
- XmlComment.cs
- DataSourceControl.cs
- CreateRefExpr.cs
- SelectionHighlightInfo.cs
- SrgsGrammar.cs
- NavigationPropertySingletonExpression.cs
- SQLMoneyStorage.cs
- NamedPipeProcessProtocolHandler.cs
- EndPoint.cs
- SqlTriggerAttribute.cs
- XmlSerializer.cs
- TransformedBitmap.cs
- Brushes.cs
- ActivityAction.cs
- FtpWebResponse.cs
- mactripleDES.cs
- X509Certificate2.cs
- GeometryConverter.cs
- ParseHttpDate.cs
- UnsafeNativeMethodsCLR.cs
- LookupNode.cs
- DependencyPropertyKey.cs
- InvokeMethod.cs
- MatrixTransform.cs
- ModelItemKeyValuePair.cs
- CorrelationToken.cs
- ButtonColumn.cs
- DoubleLink.cs
- X509CertificateCollection.cs
- StretchValidation.cs
- UnsafeNativeMethods.cs
- DesignerHelpers.cs
- EndPoint.cs
- ProcessRequestAsyncResult.cs
- Section.cs
- ThemeableAttribute.cs
- AbsoluteQuery.cs
- Region.cs
- CommandConverter.cs
- MissingSatelliteAssemblyException.cs
- ReadOnlyHierarchicalDataSourceView.cs
- StandardOleMarshalObject.cs
- QueryStringParameter.cs
- ApplyImportsAction.cs
- GenericParameterDataContract.cs
- HttpPostProtocolReflector.cs
- Cursors.cs
- ArgumentException.cs
- ListViewTableRow.cs
- CodeStatement.cs
- ToolStripGripRenderEventArgs.cs
- EvidenceTypeDescriptor.cs
- XmlLanguageConverter.cs
- TextShapeableCharacters.cs
- Resources.Designer.cs
- UniqueConstraint.cs
- OleDbException.cs
- TimersDescriptionAttribute.cs
- CqlBlock.cs
- DesignerLoader.cs
- SimpleNameService.cs