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
- InputMethodStateTypeInfo.cs
- DocumentEventArgs.cs
- ToggleButtonAutomationPeer.cs
- TraceListener.cs
- HtmlInputHidden.cs
- DataGridViewCellStyle.cs
- ObjRef.cs
- EventItfInfo.cs
- MouseWheelEventArgs.cs
- QueryContinueDragEvent.cs
- BadImageFormatException.cs
- QilBinary.cs
- Literal.cs
- MappingModelBuildProvider.cs
- DomNameTable.cs
- CodeMethodMap.cs
- XslCompiledTransform.cs
- OpCodes.cs
- ValidateNames.cs
- DifferencingCollection.cs
- TypeConverterBase.cs
- TableLayoutPanel.cs
- PageContentAsyncResult.cs
- PackageDigitalSignatureManager.cs
- HuffCodec.cs
- AsnEncodedData.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- SelectedCellsChangedEventArgs.cs
- GridViewPageEventArgs.cs
- Logging.cs
- ClientBuildManager.cs
- SuspendDesigner.cs
- DebugView.cs
- SqlDependencyUtils.cs
- InvalidOleVariantTypeException.cs
- UrlMappingCollection.cs
- MapPathBasedVirtualPathProvider.cs
- GradientStop.cs
- EntityDataSourceContainerNameConverter.cs
- BulletDecorator.cs
- InputBinder.cs
- Avt.cs
- RoutedEventConverter.cs
- WebPartManagerDesigner.cs
- ActivationServices.cs
- ScrollableControl.cs
- TransactionContextManager.cs
- ValidationHelpers.cs
- PersonalizationProviderHelper.cs
- DefaultAssemblyResolver.cs
- DataBinder.cs
- TimeStampChecker.cs
- BamlCollectionHolder.cs
- CommandBindingCollection.cs
- PermissionListSet.cs
- XmlElementCollection.cs
- Trace.cs
- HttpCapabilitiesSectionHandler.cs
- Lease.cs
- DataRowExtensions.cs
- DefaultSerializationProviderAttribute.cs
- __ComObject.cs
- CertificateManager.cs
- Command.cs
- DispatcherTimer.cs
- StructuralType.cs
- DataGrid.cs
- CipherData.cs
- HttpListenerPrefixCollection.cs
- IdleTimeoutMonitor.cs
- ExchangeUtilities.cs
- Int16Converter.cs
- shaperfactory.cs
- UnsafeNativeMethods.cs
- GeometryModel3D.cs
- TargetControlTypeCache.cs
- TableChangeProcessor.cs
- SectionInput.cs
- Primitive.cs
- SafeNativeMethods.cs
- WindowsHyperlink.cs
- Pair.cs
- ValueTypeFixupInfo.cs
- _ConnectOverlappedAsyncResult.cs
- StrokeNodeEnumerator.cs
- ExceptionUtil.cs
- CommonGetThemePartSize.cs
- DbProviderFactories.cs
- HttpListenerContext.cs
- ShapingWorkspace.cs
- SqlDataAdapter.cs
- FormView.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- DataGridViewAddColumnDialog.cs
- StylusButton.cs
- DatatypeImplementation.cs
- SourceInterpreter.cs
- GroupLabel.cs
- BackgroundWorker.cs
- EditorPart.cs