Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- HashRepartitionStream.cs
- CodePageEncoding.cs
- RightsManagementInformation.cs
- HashCodeCombiner.cs
- TemplateKeyConverter.cs
- Label.cs
- GregorianCalendar.cs
- Soap12ProtocolReflector.cs
- Triplet.cs
- ProjectionCamera.cs
- InternalTransaction.cs
- HtmlHistory.cs
- ReadWriteSpinLock.cs
- ReadOnlyCollectionBuilder.cs
- ObfuscationAttribute.cs
- CustomPopupPlacement.cs
- InternalSendMessage.cs
- DesignerResources.cs
- XamlWrappingReader.cs
- DataGridViewImageColumn.cs
- DrawingState.cs
- ReadOnlyDataSourceView.cs
- PermissionSet.cs
- MissingFieldException.cs
- TextFormatterContext.cs
- XmlValueConverter.cs
- DocumentOrderQuery.cs
- HttpCachePolicy.cs
- Ref.cs
- SplashScreenNativeMethods.cs
- SQLBinaryStorage.cs
- BitmapMetadataEnumerator.cs
- TableCell.cs
- __ComObject.cs
- MissingMemberException.cs
- MenuBase.cs
- QilValidationVisitor.cs
- FixedSOMLineRanges.cs
- NonceToken.cs
- Control.cs
- GlobalAllocSafeHandle.cs
- MergeFailedEvent.cs
- RijndaelCryptoServiceProvider.cs
- ItemsControl.cs
- SelectQueryOperator.cs
- DbConnectionOptions.cs
- Stylesheet.cs
- Material.cs
- CompatibleIComparer.cs
- DefaultTextStore.cs
- ObjectDataSourceMethodEventArgs.cs
- SlotInfo.cs
- ManifestResourceInfo.cs
- EntityConnectionStringBuilderItem.cs
- LinkClickEvent.cs
- BatchServiceHost.cs
- ExpressionVisitor.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Registry.cs
- AssemblyInfo.cs
- FormsAuthenticationEventArgs.cs
- ControlFilterExpression.cs
- WebBrowserHelper.cs
- MatrixKeyFrameCollection.cs
- OleDbEnumerator.cs
- EncryptedKey.cs
- GroupBoxAutomationPeer.cs
- EntityDataReader.cs
- Cloud.cs
- PageWrapper.cs
- StylusPointProperty.cs
- CheckBoxRenderer.cs
- DurableInstanceProvider.cs
- ImageBrush.cs
- FixedSchema.cs
- UpdatePanelControlTrigger.cs
- DataViewSettingCollection.cs
- ObjectDataSourceStatusEventArgs.cs
- XPathDocument.cs
- ListViewPagedDataSource.cs
- ListenerElementsCollection.cs
- EventSetter.cs
- WebPartEditorOkVerb.cs
- WebPartDescription.cs
- DeploymentExceptionMapper.cs
- IntegerValidator.cs
- SoapHeaderException.cs
- TripleDES.cs
- SizeConverter.cs
- ComponentSerializationService.cs
- UriSection.cs
- PageBreakRecord.cs
- ConstructorArgumentAttribute.cs
- DataGridDesigner.cs
- TypeCodeDomSerializer.cs
- BooleanAnimationUsingKeyFrames.cs
- DataRowCollection.cs
- WindowsHyperlink.cs
- ColorAnimation.cs
- CompilerScopeManager.cs