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
- SmtpNegotiateAuthenticationModule.cs
- ObjectTag.cs
- WebPartExportVerb.cs
- MasterPage.cs
- LinqDataSourceView.cs
- TraceSection.cs
- ErrorInfoXmlDocument.cs
- DefaultParameterValueAttribute.cs
- Int32CollectionConverter.cs
- MimeFormImporter.cs
- RectAnimationUsingKeyFrames.cs
- ParserHooks.cs
- glyphs.cs
- CodeTypeConstructor.cs
- SubMenuStyleCollection.cs
- OraclePermission.cs
- SqlDelegatedTransaction.cs
- TimeIntervalCollection.cs
- CodeLabeledStatement.cs
- CodeDOMProvider.cs
- SchemaImporterExtensionsSection.cs
- HijriCalendar.cs
- TdsParserStaticMethods.cs
- DbCommandDefinition.cs
- EventArgs.cs
- GridItem.cs
- CustomCategoryAttribute.cs
- MTConfigUtil.cs
- ZeroOpNode.cs
- MethodBuilderInstantiation.cs
- MD5.cs
- PieceNameHelper.cs
- RequestQueue.cs
- XmlTypeMapping.cs
- SqlWorkflowPersistenceService.cs
- HttpRuntime.cs
- InvalidCastException.cs
- GenericWebPart.cs
- DecodeHelper.cs
- sqlinternaltransaction.cs
- FloaterBaseParagraph.cs
- ZipIOFileItemStream.cs
- AssociatedControlConverter.cs
- TypeLoadException.cs
- TypeSemantics.cs
- BrowserDefinitionCollection.cs
- MaterializeFromAtom.cs
- PointAnimationUsingPath.cs
- DnsEndPoint.cs
- DataBoundControlAdapter.cs
- AutomationFocusChangedEventArgs.cs
- AccessedThroughPropertyAttribute.cs
- SQLGuidStorage.cs
- ClientSponsor.cs
- WebPartCatalogCloseVerb.cs
- SignatureTargetIdManager.cs
- TextServicesManager.cs
- XmlStreamStore.cs
- ObjectCacheHost.cs
- EventRouteFactory.cs
- QilInvokeLateBound.cs
- UserPreferenceChangedEventArgs.cs
- VirtualPathExtension.cs
- EventLogTraceListener.cs
- SoapAttributes.cs
- WindowsToolbarAsMenu.cs
- Package.cs
- EncoderNLS.cs
- PngBitmapDecoder.cs
- RichTextBoxAutomationPeer.cs
- DataRowView.cs
- SwitchDesigner.xaml.cs
- GifBitmapDecoder.cs
- PlatformNotSupportedException.cs
- ExpressionSelection.cs
- ComponentResourceKeyConverter.cs
- Calendar.cs
- DoubleLinkList.cs
- CommandField.cs
- CookielessData.cs
- EtwTrackingBehavior.cs
- EventLogException.cs
- ModelPropertyDescriptor.cs
- AddInActivator.cs
- mil_commands.cs
- CompiledQuery.cs
- uribuilder.cs
- JpegBitmapEncoder.cs
- DesignerLabelAdapter.cs
- VisualBasicReference.cs
- DeflateInput.cs
- Assembly.cs
- TextRenderer.cs
- SymbolDocumentGenerator.cs
- ChangeTracker.cs
- RegexBoyerMoore.cs
- VerificationAttribute.cs
- RowSpanVector.cs
- Logging.cs
- bidPrivateBase.cs