Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Messaging / System / Messaging / Interop / Columns.cs / 1305376 / Columns.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Messaging.Interop { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.ComponentModel; using System.Globalization; //for CultureInfo using Microsoft.Win32; internal class Columns { private int maxCount; private MQCOLUMNSET columnSet = new MQCOLUMNSET(); public Columns(int maxCount) { this.maxCount = maxCount; this.columnSet.columnIdentifiers = Marshal.AllocHGlobal(maxCount * 4); this.columnSet.columnCount = 0; } public virtual void AddColumnId(int columnId) { lock(this) { if (this.columnSet.columnCount >= this.maxCount) throw new InvalidOperationException(Res.GetString(Res.TooManyColumns, this.maxCount.ToString(CultureInfo.CurrentCulture))); ++ this.columnSet.columnCount; this.columnSet.SetId(columnId, this.columnSet.columnCount - 1); } } public virtual MQCOLUMNSET GetColumnsRef() { return this.columnSet; } [StructLayout(LayoutKind.Sequential)] public class MQCOLUMNSET{ public int columnCount; [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] public IntPtr columnIdentifiers; ~MQCOLUMNSET() { if (this.columnIdentifiers != (IntPtr)0) { Marshal.FreeHGlobal(this.columnIdentifiers); this.columnIdentifiers = (IntPtr)0; } } public virtual void SetId(int columnId, int index) { Marshal.WriteInt32((IntPtr)((long)this.columnIdentifiers + (index * 4)), columnId); } } } } // 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
- CheckBoxFlatAdapter.cs
- XmlEncoding.cs
- WhitespaceSignificantCollectionAttribute.cs
- ReadOnlyDictionary.cs
- HttpApplicationStateWrapper.cs
- SpStreamWrapper.cs
- ResourceDescriptionAttribute.cs
- NamespaceEmitter.cs
- DataServiceQueryProvider.cs
- SqlExpander.cs
- DbReferenceCollection.cs
- BitSet.cs
- HelpProvider.cs
- ForwardPositionQuery.cs
- ContentDisposition.cs
- Shared.cs
- CodeObjectCreateExpression.cs
- AnnotationService.cs
- SqlAggregateChecker.cs
- ConfigXmlComment.cs
- RenameRuleObjectDialog.cs
- XmlSchemaExternal.cs
- FormViewDeleteEventArgs.cs
- _CookieModule.cs
- DataControlFieldHeaderCell.cs
- SourceItem.cs
- TextDecorationCollection.cs
- ChildChangedEventArgs.cs
- DeobfuscatingStream.cs
- XmlSchemaAppInfo.cs
- HostedNamedPipeTransportManager.cs
- returneventsaver.cs
- FixedDocument.cs
- TaiwanLunisolarCalendar.cs
- ChildDocumentBlock.cs
- RSAOAEPKeyExchangeDeformatter.cs
- QuotedPrintableStream.cs
- InternalConfigRoot.cs
- DeviceSpecificChoiceCollection.cs
- unsafenativemethodsother.cs
- Ipv6Element.cs
- CngKey.cs
- WebBrowserEvent.cs
- KnownAssemblyEntry.cs
- DragEvent.cs
- SByte.cs
- UndirectedGraph.cs
- LogicalExpressionEditor.cs
- WebPartConnectionsConnectVerb.cs
- SqlTypesSchemaImporter.cs
- ConnectionPointConverter.cs
- HttpCapabilitiesEvaluator.cs
- JavaScriptObjectDeserializer.cs
- HandleCollector.cs
- TextServicesContext.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataGridRow.cs
- ThreadNeutralSemaphore.cs
- OracleInternalConnection.cs
- DropShadowBitmapEffect.cs
- DbConnectionHelper.cs
- SQLInt32.cs
- FormsIdentity.cs
- Mutex.cs
- Identity.cs
- DataBindingCollectionEditor.cs
- ResXFileRef.cs
- PaperSize.cs
- CacheOutputQuery.cs
- XmlnsCompatibleWithAttribute.cs
- TableLayoutPanelDesigner.cs
- ProfileGroupSettingsCollection.cs
- EastAsianLunisolarCalendar.cs
- SymbolDocumentGenerator.cs
- TagPrefixAttribute.cs
- CreateUserWizardDesigner.cs
- AssemblyResolver.cs
- HandleRef.cs
- NameValueFileSectionHandler.cs
- InputBinder.cs
- ErrorWrapper.cs
- WinFormsUtils.cs
- HopperCache.cs
- RegionInfo.cs
- BidirectionalDictionary.cs
- InkCanvasSelection.cs
- RankException.cs
- ItemDragEvent.cs
- Button.cs
- Activator.cs
- Int32Rect.cs
- ComponentChangingEvent.cs
- FlowDocumentPageViewerAutomationPeer.cs
- HTMLTextWriter.cs
- _MultipleConnectAsync.cs
- UriTemplateTrieNode.cs
- CookielessHelper.cs
- ModelUIElement3D.cs
- AttachedPropertyDescriptor.cs
- OrderedDictionary.cs