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
- SiteIdentityPermission.cs
- ProgressBar.cs
- AttachmentCollection.cs
- COM2ExtendedBrowsingHandler.cs
- HostProtectionException.cs
- SmiGettersStream.cs
- XPathDocumentIterator.cs
- WindowsListBox.cs
- ContextInformation.cs
- ClassImporter.cs
- UnsafeNativeMethods.cs
- ProfileModule.cs
- XPathNodePointer.cs
- CommentEmitter.cs
- StreamGeometry.cs
- NotifyParentPropertyAttribute.cs
- SHA1Managed.cs
- FontClient.cs
- mediaeventshelper.cs
- FrameworkEventSource.cs
- _ScatterGatherBuffers.cs
- EmptyCollection.cs
- cookiecollection.cs
- HandleExceptionArgs.cs
- CacheRequest.cs
- StandardTransformFactory.cs
- SrgsSubset.cs
- ControlIdConverter.cs
- LocalValueEnumerator.cs
- CellTreeNodeVisitors.cs
- InvalidPrinterException.cs
- WSSecurityTokenSerializer.cs
- ParserOptions.cs
- EncryptedData.cs
- XMLUtil.cs
- FlowDocumentReader.cs
- UpdateCommand.cs
- PropertyMapper.cs
- TeredoHelper.cs
- ParallelTimeline.cs
- MenuItem.cs
- _LocalDataStoreMgr.cs
- ScrollViewerAutomationPeer.cs
- DetailsViewRow.cs
- MulticastDelegate.cs
- ObjectConverter.cs
- BamlWriter.cs
- messageonlyhwndwrapper.cs
- Expression.cs
- _HeaderInfoTable.cs
- WindowsListView.cs
- FilterableData.cs
- Color.cs
- ActiveXContainer.cs
- RawStylusSystemGestureInputReport.cs
- ChannelDemuxer.cs
- SoapAttributeAttribute.cs
- FlowLayoutSettings.cs
- Attributes.cs
- DocumentPageTextView.cs
- Activity.cs
- MatrixConverter.cs
- PersonalizationState.cs
- XPathParser.cs
- LocalizationParserHooks.cs
- ExeConfigurationFileMap.cs
- _DomainName.cs
- Char.cs
- OracleDateTime.cs
- ApplicationManager.cs
- WpfKnownTypeInvoker.cs
- XmlDeclaration.cs
- DependencyStoreSurrogate.cs
- ExpressionBuilderContext.cs
- TrustManagerMoreInformation.cs
- SR.cs
- QueryActivatableWorkflowsCommand.cs
- HwndSourceParameters.cs
- KnownBoxes.cs
- Model3DCollection.cs
- BackgroundFormatInfo.cs
- SystemColorTracker.cs
- SafeEventHandle.cs
- ReadonlyMessageFilter.cs
- ProgressiveCrcCalculatingStream.cs
- ColorTransform.cs
- ArrayEditor.cs
- SByte.cs
- PTProvider.cs
- TextRange.cs
- ProfileProvider.cs
- WebConfigurationHost.cs
- InvokeProviderWrapper.cs
- SimpleBitVector32.cs
- BrowserCapabilitiesFactory35.cs
- UiaCoreProviderApi.cs
- GuidelineCollection.cs
- TextWriter.cs
- LayoutTableCell.cs
- XmlSchemaAll.cs