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
- FactoryGenerator.cs
- ValidateNames.cs
- AudioDeviceOut.cs
- StylusDevice.cs
- Point3D.cs
- WorkflowRuntime.cs
- HandlerMappingMemo.cs
- Point3D.cs
- JavaScriptString.cs
- SignedPkcs7.cs
- StorageModelBuildProvider.cs
- LazyTextWriterCreator.cs
- HtmlElementEventArgs.cs
- SplitterCancelEvent.cs
- Vector3dCollection.cs
- ScaleTransform.cs
- DataGridRow.cs
- SessionPageStatePersister.cs
- SQLResource.cs
- DesignerOptionService.cs
- JsonQNameDataContract.cs
- EntityReference.cs
- figurelength.cs
- RemoteWebConfigurationHostStream.cs
- TableRowCollection.cs
- ReaderOutput.cs
- TimeoutValidationAttribute.cs
- SQLGuidStorage.cs
- GroupQuery.cs
- MetadataItem.cs
- TemplateField.cs
- Mappings.cs
- TreeViewHitTestInfo.cs
- ValidationPropertyAttribute.cs
- SoapIgnoreAttribute.cs
- ArrayList.cs
- XmlSchemaObjectTable.cs
- SchemaDeclBase.cs
- SQLByteStorage.cs
- TileModeValidation.cs
- XmlNodeList.cs
- SmiTypedGetterSetter.cs
- HttpHeaderCollection.cs
- SafeProcessHandle.cs
- EncoderNLS.cs
- TransformProviderWrapper.cs
- DynamicRenderer.cs
- EdmComplexPropertyAttribute.cs
- DataGridCommandEventArgs.cs
- shaperfactory.cs
- HttpGetServerProtocol.cs
- MultiSelectRootGridEntry.cs
- ManagementOptions.cs
- ListViewUpdateEventArgs.cs
- PostBackOptions.cs
- SqlClientMetaDataCollectionNames.cs
- TableColumnCollectionInternal.cs
- MatrixCamera.cs
- AstTree.cs
- TimeoutException.cs
- EntityContainerRelationshipSet.cs
- MD5CryptoServiceProvider.cs
- LocatorGroup.cs
- XsltArgumentList.cs
- NativeMethods.cs
- Regex.cs
- TextLine.cs
- HandleRef.cs
- FormViewRow.cs
- SafeNativeMethods.cs
- Size.cs
- Control.cs
- MultiTrigger.cs
- ModelVisual3D.cs
- ProgressBarRenderer.cs
- Row.cs
- AmbientEnvironment.cs
- _AuthenticationState.cs
- CompositeControl.cs
- QualifiedCellIdBoolean.cs
- DoubleAverageAggregationOperator.cs
- CompilerCollection.cs
- ContextItem.cs
- Token.cs
- Rules.cs
- ActivityTypeResolver.xaml.cs
- PopOutPanel.cs
- PointLightBase.cs
- DnsPermission.cs
- WindowsHyperlink.cs
- SettingsSavedEventArgs.cs
- SimpleHandlerFactory.cs
- ValidatorCollection.cs
- WorkflowOperationInvoker.cs
- FilterException.cs
- UniqueEventHelper.cs
- ResourceAssociationSetEnd.cs
- ToolStripDesigner.cs
- SemaphoreFullException.cs
- XmlSchemaComplexContentRestriction.cs