Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / OleDb / OleDbReferenceCollection.cs / 1305376 / OleDbReferenceCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; using System.Runtime.InteropServices; sealed internal class OleDbReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Canceling = -1; internal const int CommandTag = 1; internal const int DataReaderTag = 2; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { bool canceling = (Canceling == message); if (CommandTag == tag) { ((OleDbCommand) value).CloseCommandFromConnection(canceling); } else if (DataReaderTag == tag) { ((OleDbDataReader) value).CloseReaderFromConnection(canceling); } else { Debug.Assert(false, "shouldn't be here"); } return false; // remove it from the collection } override public void Remove(object value) { base.RemoveItem(value); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; using System.Runtime.InteropServices; sealed internal class OleDbReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Canceling = -1; internal const int CommandTag = 1; internal const int DataReaderTag = 2; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { bool canceling = (Canceling == message); if (CommandTag == tag) { ((OleDbCommand) value).CloseCommandFromConnection(canceling); } else if (DataReaderTag == tag) { ((OleDbDataReader) value).CloseReaderFromConnection(canceling); } else { Debug.Assert(false, "shouldn't be here"); } return false; // remove it from the collection } override public void Remove(object value) { base.RemoveItem(value); } } } // 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
- RootBrowserWindowAutomationPeer.cs
- CursorConverter.cs
- GeneralTransform3D.cs
- _ProxyRegBlob.cs
- ShapingEngine.cs
- UrlParameterReader.cs
- CTreeGenerator.cs
- DisposableCollectionWrapper.cs
- Visual3D.cs
- FrameworkElementAutomationPeer.cs
- TextTreeFixupNode.cs
- PromptBuilder.cs
- TreeIterator.cs
- RegexBoyerMoore.cs
- InvalidCastException.cs
- OperationParameterInfoCollection.cs
- WebPartChrome.cs
- DisplayNameAttribute.cs
- ImageSource.cs
- MethodBody.cs
- BrowserInteropHelper.cs
- shaperfactoryquerycacheentry.cs
- SoapAttributes.cs
- BehaviorService.cs
- XmlValueConverter.cs
- DataGridItemCollection.cs
- DetailsViewInsertEventArgs.cs
- XDRSchema.cs
- SqlCacheDependency.cs
- MaterialGroup.cs
- FormsIdentity.cs
- SystemWebExtensionsSectionGroup.cs
- SelectionItemProviderWrapper.cs
- HyperLinkStyle.cs
- EventItfInfo.cs
- TryExpression.cs
- XmlnsDictionary.cs
- TextContainerChangeEventArgs.cs
- HTMLTagNameToTypeMapper.cs
- InkCanvas.cs
- ToolStripItemCollection.cs
- CfgParser.cs
- XmlSchemaIdentityConstraint.cs
- CharStorage.cs
- StyleBamlTreeBuilder.cs
- XmlValidatingReaderImpl.cs
- TrustVersion.cs
- TrackingProfileDeserializationException.cs
- FormViewPagerRow.cs
- FixedDocumentSequencePaginator.cs
- ServiceModelTimeSpanValidator.cs
- SqlDuplicator.cs
- BrowserCapabilitiesCodeGenerator.cs
- CollectionViewSource.cs
- IdnMapping.cs
- SizeConverter.cs
- xsdvalidator.cs
- HuffmanTree.cs
- EntityWrapperFactory.cs
- ApplicationSecurityInfo.cs
- _ConnectionGroup.cs
- SoundPlayerAction.cs
- SpotLight.cs
- DataControlImageButton.cs
- ResourcePool.cs
- DataGridViewCellStyleBuilderDialog.cs
- MethodCallConverter.cs
- SBCSCodePageEncoding.cs
- ComponentCodeDomSerializer.cs
- ManagedIStream.cs
- ObjectViewFactory.cs
- _NTAuthentication.cs
- PointCollectionValueSerializer.cs
- SqlGatherProducedAliases.cs
- DynamicQueryableWrapper.cs
- XmlSchemaAll.cs
- Control.cs
- GeneralTransform3DCollection.cs
- WinEventHandler.cs
- SqlInternalConnectionTds.cs
- SchemaElementDecl.cs
- HttpContextServiceHost.cs
- VirtualPath.cs
- ImageFormat.cs
- hresults.cs
- XmlElement.cs
- CustomAttributeBuilder.cs
- CriticalExceptions.cs
- ParameterExpression.cs
- RotateTransform3D.cs
- ExpressionPrinter.cs
- ChameleonKey.cs
- ScopeCompiler.cs
- TableLayoutSettings.cs
- SchemaImporter.cs
- SqlCaseSimplifier.cs
- ArgumentDirectionHelper.cs
- BaseDataList.cs
- TrustLevelCollection.cs
- OutKeywords.cs