Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ThousandthOfEmRealPoints.cs
- ServiceProviders.cs
- EncoderNLS.cs
- ExtractorMetadata.cs
- JapaneseCalendar.cs
- EntityDesignPluralizationHandler.cs
- EventProviderTraceListener.cs
- IPAddress.cs
- DataColumnChangeEvent.cs
- DataGridCellsPanel.cs
- Zone.cs
- _IPv6Address.cs
- XPathDocument.cs
- TreeNode.cs
- ExpandCollapsePatternIdentifiers.cs
- JournalEntry.cs
- SingleTagSectionHandler.cs
- BatchParser.cs
- NamedElement.cs
- DbProviderFactoriesConfigurationHandler.cs
- FullTrustAssembliesSection.cs
- SharedConnectionInfo.cs
- RijndaelManagedTransform.cs
- HttpCacheVaryByContentEncodings.cs
- RequestQueue.cs
- Delegate.cs
- TransportContext.cs
- ValueOfAction.cs
- VisualCollection.cs
- ManagementScope.cs
- RadioButtonList.cs
- CodeSnippetTypeMember.cs
- WebBrowser.cs
- CompiledAction.cs
- SchemaElementDecl.cs
- QuadraticEase.cs
- HttpWebResponse.cs
- SourceChangedEventArgs.cs
- FixedTextBuilder.cs
- HtmlTableRow.cs
- _Semaphore.cs
- SqlWebEventProvider.cs
- ReadOnlyDataSource.cs
- TagMapInfo.cs
- TrustLevelCollection.cs
- SerialPinChanges.cs
- GifBitmapEncoder.cs
- SmtpFailedRecipientException.cs
- EventLogTraceListener.cs
- ParameterExpression.cs
- Calendar.cs
- ChangesetResponse.cs
- _CacheStreams.cs
- UnitySerializationHolder.cs
- NTAccount.cs
- GradientBrush.cs
- CollectionsUtil.cs
- DtrList.cs
- SqlCommandBuilder.cs
- ContentTypeSettingDispatchMessageFormatter.cs
- CacheSection.cs
- SHA256.cs
- Convert.cs
- VectorConverter.cs
- SequentialUshortCollection.cs
- NativeMethods.cs
- Descriptor.cs
- BindingManagerDataErrorEventArgs.cs
- CommonProperties.cs
- MemoryStream.cs
- OracleConnectionFactory.cs
- HMACRIPEMD160.cs
- ButtonBase.cs
- MappedMetaModel.cs
- GenericWebPart.cs
- DataRowExtensions.cs
- COM2IDispatchConverter.cs
- NotificationContext.cs
- AuthenticatedStream.cs
- BidPrivateBase.cs
- ApplicationProxyInternal.cs
- InlineCategoriesDocument.cs
- ToolStripProgressBar.cs
- GridSplitter.cs
- TreeIterators.cs
- ByteConverter.cs
- FrameworkObject.cs
- AppManager.cs
- ProfileModule.cs
- SocketPermission.cs
- ObjectAnimationUsingKeyFrames.cs
- _NtlmClient.cs
- SystemDiagnosticsSection.cs
- DependencyPropertyHelper.cs
- SessionState.cs
- UpdateRecord.cs
- UpdateException.cs
- EntityDataSourceStatementEditor.cs
- ComponentDispatcher.cs
- HtmlSelect.cs