Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / Odbc / OdbcReferenceCollection.cs / 1 / OdbcReferenceCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; namespace System.Data.Odbc { sealed internal class OdbcReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Recover = 1; internal const int CommandTag = 1; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { switch (message) { case Recover: if (CommandTag == tag) { ((OdbcCommand) value).RecoverFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; case Closing: if (CommandTag == tag) { ((OdbcCommand) value).CloseFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; default: Debug.Assert(false, "shouldn't be here"); break; } 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. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; namespace System.Data.Odbc { sealed internal class OdbcReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Recover = 1; internal const int CommandTag = 1; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { switch (message) { case Recover: if (CommandTag == tag) { ((OdbcCommand) value).RecoverFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; case Closing: if (CommandTag == tag) { ((OdbcCommand) value).CloseFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; default: Debug.Assert(false, "shouldn't be here"); break; } 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
- CultureSpecificStringDictionary.cs
- ParallelEnumerable.cs
- Journal.cs
- SafeSystemMetrics.cs
- TimeoutHelper.cs
- OutputCacheProfileCollection.cs
- DetailsViewUpdateEventArgs.cs
- SoapCodeExporter.cs
- SQLDecimal.cs
- EventLogEntryCollection.cs
- BasicExpandProvider.cs
- ImageField.cs
- InheritanceContextHelper.cs
- CombinedGeometry.cs
- CacheOutputQuery.cs
- NodeInfo.cs
- WebConfigurationHostFileChange.cs
- Button.cs
- AppDomainEvidenceFactory.cs
- AvTraceDetails.cs
- AvtEvent.cs
- SystemColorTracker.cs
- SynchronizationContext.cs
- MachineKeyConverter.cs
- GcSettings.cs
- DataSourceListEditor.cs
- SQLBinaryStorage.cs
- SspiNegotiationTokenAuthenticatorState.cs
- Brush.cs
- DataViewListener.cs
- FamilyCollection.cs
- SerialErrors.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- Equal.cs
- MetadataSource.cs
- Trace.cs
- categoryentry.cs
- TypedTableBase.cs
- TextAutomationPeer.cs
- PerspectiveCamera.cs
- EntityClassGenerator.cs
- HtmlTextBoxAdapter.cs
- SqlCacheDependency.cs
- Options.cs
- XamlUtilities.cs
- CompoundFileStorageReference.cs
- ListenerSessionConnection.cs
- BitmapCache.cs
- SqlServer2KCompatibilityAnnotation.cs
- Context.cs
- WebContext.cs
- AudioStateChangedEventArgs.cs
- DesignSurfaceManager.cs
- SystemSounds.cs
- x509utils.cs
- DirectoryLocalQuery.cs
- DataControlLinkButton.cs
- DSASignatureDeformatter.cs
- HtmlInputFile.cs
- BuildProvider.cs
- PointAnimationUsingPath.cs
- SystemIPInterfaceStatistics.cs
- ListMarkerSourceInfo.cs
- AttributeProviderAttribute.cs
- CodeTypeReferenceExpression.cs
- DocumentPageView.cs
- DeviceOverridableAttribute.cs
- NotifyParentPropertyAttribute.cs
- StreamedFramingRequestChannel.cs
- HwndAppCommandInputProvider.cs
- formatstringdialog.cs
- PersianCalendar.cs
- Accessible.cs
- DefaultSection.cs
- X509Logo.cs
- StringBuilder.cs
- Axis.cs
- XamlHostingSectionGroup.cs
- CodeTypeReferenceCollection.cs
- ActivityExecutor.cs
- Empty.cs
- VSDExceptions.cs
- WindowsTokenRoleProvider.cs
- XpsFilter.cs
- ViewGenerator.cs
- Stopwatch.cs
- returneventsaver.cs
- TableParaClient.cs
- FixUp.cs
- ExpressionsCollectionConverter.cs
- GridViewColumnHeaderAutomationPeer.cs
- RootNamespaceAttribute.cs
- CompoundFileDeflateTransform.cs
- Int32.cs
- SelfIssuedAuthRSACryptoProvider.cs
- SqlErrorCollection.cs
- TabPanel.cs
- MobileListItem.cs
- InlinedAggregationOperatorEnumerator.cs
- InstanceData.cs