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
- LingerOption.cs
- ProtocolsConfigurationEntry.cs
- MessageAction.cs
- DynamicEntity.cs
- MSAANativeProvider.cs
- InkCanvasSelection.cs
- handlecollector.cs
- WSIdentityFaultException.cs
- DesignerActionUI.cs
- AnnotationComponentChooser.cs
- NullableDoubleMinMaxAggregationOperator.cs
- VirtualDirectoryMappingCollection.cs
- CroppedBitmap.cs
- EntityDescriptor.cs
- ClientCultureInfo.cs
- OwnerDrawPropertyBag.cs
- HtmlInputSubmit.cs
- SafeTokenHandle.cs
- CustomLineCap.cs
- Point3DCollection.cs
- BookmarkNameHelper.cs
- AddInContractAttribute.cs
- HttpValueCollection.cs
- _SpnDictionary.cs
- ToolConsole.cs
- DelegateSerializationHolder.cs
- ResourceSet.cs
- ControlAdapter.cs
- EntityProviderFactory.cs
- HtmlElementErrorEventArgs.cs
- GeometryGroup.cs
- ConnectionStringsSection.cs
- SessionStateSection.cs
- DataGridViewTextBoxCell.cs
- Image.cs
- JsonByteArrayDataContract.cs
- GeneralTransform3D.cs
- ContextCorrelationInitializer.cs
- ConnectionStringsExpressionEditor.cs
- SqlUserDefinedAggregateAttribute.cs
- StopRoutingHandler.cs
- COM2PictureConverter.cs
- Int32Rect.cs
- DeadCharTextComposition.cs
- Rectangle.cs
- AutomationPatternInfo.cs
- Constraint.cs
- CodeLinePragma.cs
- ResetableIterator.cs
- SafeNativeMethods.cs
- ClusterUtils.cs
- BitmapEffectDrawing.cs
- CodeParameterDeclarationExpression.cs
- LoadItemsEventArgs.cs
- SoapMessage.cs
- OptimalTextSource.cs
- ResolveMatchesApril2005.cs
- DoWorkEventArgs.cs
- ViewGenResults.cs
- TdsParserStateObject.cs
- XmlAnyElementAttribute.cs
- InvokeAction.cs
- XmlElementList.cs
- RadialGradientBrush.cs
- XmlObjectSerializerReadContext.cs
- commandenforcer.cs
- BuildResultCache.cs
- ProvideValueServiceProvider.cs
- SiteMapDataSourceView.cs
- RoutedEvent.cs
- ServiceObjectContainer.cs
- Assembly.cs
- Point.cs
- ImportContext.cs
- EtwTrackingBehavior.cs
- DataChangedEventManager.cs
- ToolStripHighContrastRenderer.cs
- DBConnectionString.cs
- KeyInterop.cs
- ApplicationSecurityManager.cs
- MethodCallConverter.cs
- AssemblyFilter.cs
- XmlSchemaAttributeGroup.cs
- GifBitmapEncoder.cs
- TableChangeProcessor.cs
- SafeNativeMethods.cs
- GlobalItem.cs
- CellTreeNodeVisitors.cs
- EventLogger.cs
- UserNameSecurityTokenAuthenticator.cs
- XmlUTF8TextReader.cs
- Attachment.cs
- ProtocolImporter.cs
- FileDialogPermission.cs
- DoubleAnimationBase.cs
- PermissionAttributes.cs
- NetworkInterface.cs
- CustomErrorsSection.cs
- WebPartTransformerAttribute.cs
- SymmetricAlgorithm.cs