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 / 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
- TypeSystem.cs
- BlobPersonalizationState.cs
- SharedUtils.cs
- DesignerView.cs
- BitmapEffect.cs
- NameTable.cs
- XmlDataContract.cs
- MergeFilterQuery.cs
- SqlPersonalizationProvider.cs
- WebFaultException.cs
- ControlDesigner.cs
- RewritingSimplifier.cs
- Converter.cs
- ReaderOutput.cs
- MutexSecurity.cs
- IdentityModelStringsVersion1.cs
- Literal.cs
- SafeTokenHandle.cs
- AllMembershipCondition.cs
- FreezableOperations.cs
- Point3DValueSerializer.cs
- PropertyConverter.cs
- ToolStripItemTextRenderEventArgs.cs
- DataGridHelper.cs
- UnsafeNativeMethods.cs
- HierarchicalDataSourceControl.cs
- SqlInternalConnectionSmi.cs
- BitmapEffectGroup.cs
- UnmanagedHandle.cs
- CustomAttribute.cs
- LiteralLink.cs
- ScrollBar.cs
- ImportCatalogPart.cs
- QueryableDataSourceEditData.cs
- TypeSystemProvider.cs
- CellIdBoolean.cs
- AnnotationComponentChooser.cs
- ThemeDirectoryCompiler.cs
- FormatPage.cs
- SecurityState.cs
- WebSysDescriptionAttribute.cs
- SineEase.cs
- NavigationHelper.cs
- FormDesigner.cs
- Size3DConverter.cs
- WebRequestModuleElement.cs
- AliasGenerator.cs
- _CacheStreams.cs
- NameTable.cs
- UnsafeNativeMethods.cs
- ResXResourceSet.cs
- AspCompat.cs
- ListViewDataItem.cs
- ColumnResizeAdorner.cs
- ExtendedPropertyDescriptor.cs
- RSAPKCS1SignatureDeformatter.cs
- NotFiniteNumberException.cs
- SemanticValue.cs
- Token.cs
- errorpatternmatcher.cs
- ColorConverter.cs
- InputScopeConverter.cs
- _FtpControlStream.cs
- ReflectionTypeLoadException.cs
- HighlightComponent.cs
- ISessionStateStore.cs
- LogRestartAreaEnumerator.cs
- SapiGrammar.cs
- PrintEvent.cs
- MemberHolder.cs
- NavigationProgressEventArgs.cs
- ZipIOBlockManager.cs
- StaticSiteMapProvider.cs
- versioninfo.cs
- CaseInsensitiveComparer.cs
- MasterPageCodeDomTreeGenerator.cs
- SortedDictionary.cs
- BitStack.cs
- GroupBox.cs
- CryptoConfig.cs
- NativeObjectSecurity.cs
- EventLogInternal.cs
- CallbackException.cs
- _ContextAwareResult.cs
- Vector.cs
- CustomCredentialPolicy.cs
- SiteMapDataSourceDesigner.cs
- FileDialog.cs
- Region.cs
- ExceptionUtil.cs
- Win32.cs
- OutputScope.cs
- TextStore.cs
- Pen.cs
- GeometryDrawing.cs
- GenerateTemporaryTargetAssembly.cs
- SQLDecimalStorage.cs
- PartitionedStreamMerger.cs
- FrameworkPropertyMetadata.cs
- _Semaphore.cs