Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / OleDb / OleDbReferenceCollection.cs / 1 / 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
- NamedPipeProcessProtocolHandler.cs
- ScriptControlDescriptor.cs
- BasicDesignerLoader.cs
- UiaCoreTypesApi.cs
- DocumentReferenceCollection.cs
- FixedPosition.cs
- PartialArray.cs
- Pkcs7Recipient.cs
- ToolStripDropDown.cs
- HttpConfigurationContext.cs
- StoreConnection.cs
- RemoteCryptoRsaServiceProvider.cs
- HiddenFieldPageStatePersister.cs
- ProxyAttribute.cs
- InProcStateClientManager.cs
- Currency.cs
- DataGridPagerStyle.cs
- QilTargetType.cs
- StorageTypeMapping.cs
- Function.cs
- Visitors.cs
- Activation.cs
- NetNamedPipeBindingElement.cs
- WinInet.cs
- Light.cs
- CodeBlockBuilder.cs
- XmlSiteMapProvider.cs
- SQLByteStorage.cs
- Socket.cs
- WinInet.cs
- RadioButtonList.cs
- UserPreferenceChangingEventArgs.cs
- DataBindingExpressionBuilder.cs
- BaseAsyncResult.cs
- ObjectAnimationUsingKeyFrames.cs
- WebZone.cs
- MenuBase.cs
- MarkupWriter.cs
- LazyTextWriterCreator.cs
- CodeStatementCollection.cs
- Literal.cs
- ScrollItemProviderWrapper.cs
- ClockController.cs
- RtfControls.cs
- SendKeys.cs
- XmlILStorageConverter.cs
- ILGen.cs
- FileCodeGroup.cs
- SqlXml.cs
- RtfControlWordInfo.cs
- BidPrivateBase.cs
- PersonalizationStateInfo.cs
- DiagnosticTraceSource.cs
- QuestionEventArgs.cs
- DataGridViewCellValidatingEventArgs.cs
- TextTreeInsertElementUndoUnit.cs
- PersonalizableAttribute.cs
- XmlSchemaObject.cs
- JoinSymbol.cs
- SqlBuilder.cs
- QilStrConcat.cs
- SelectedDatesCollection.cs
- HttpCapabilitiesSectionHandler.cs
- ConditionedDesigner.cs
- TaskFormBase.cs
- SignatureToken.cs
- WebConfigurationManager.cs
- BuilderPropertyEntry.cs
- Int64Converter.cs
- DataView.cs
- PageOutputColor.cs
- PlacementWorkspace.cs
- SafeLibraryHandle.cs
- FormatterServicesNoSerializableCheck.cs
- Cursor.cs
- DispatcherObject.cs
- BamlLocalizer.cs
- StoreItemCollection.cs
- HttpChannelHelper.cs
- SignedPkcs7.cs
- input.cs
- XPathAncestorQuery.cs
- CreateUserWizardStep.cs
- WorkflowView.cs
- Walker.cs
- WebPartActionVerb.cs
- ResXBuildProvider.cs
- ConcurrencyMode.cs
- Constants.cs
- EncryptedPackage.cs
- ControlEvent.cs
- SimpleHandlerFactory.cs
- CustomSignedXml.cs
- parserscommon.cs
- CommandHelpers.cs
- OutputCacheSettingsSection.cs
- ProgressBarBrushConverter.cs
- Semaphore.cs
- ClientType.cs
- SystemFonts.cs