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
- UserControlParser.cs
- ColorMap.cs
- FieldDescriptor.cs
- XPathNodeIterator.cs
- HtmlElement.cs
- RecipientInfo.cs
- ZipFileInfoCollection.cs
- ScriptResourceAttribute.cs
- CursorConverter.cs
- FontFamilyValueSerializer.cs
- SchemaInfo.cs
- ObjectCacheSettings.cs
- SchemaCreator.cs
- WebPartVerbsEventArgs.cs
- HtmlMobileTextWriter.cs
- HMAC.cs
- PatternMatchRules.cs
- ComplexPropertyEntry.cs
- DataObjectCopyingEventArgs.cs
- SmiEventSink_Default.cs
- CompilerTypeWithParams.cs
- ResourceDefaultValueAttribute.cs
- AnimatedTypeHelpers.cs
- TableCell.cs
- SettingsProperty.cs
- IisNotInstalledException.cs
- LinkedResource.cs
- BamlRecords.cs
- SiteMapProvider.cs
- BlobPersonalizationState.cs
- ToolStripSplitButton.cs
- TiffBitmapEncoder.cs
- CornerRadius.cs
- DynamicILGenerator.cs
- GridViewCancelEditEventArgs.cs
- CustomLineCap.cs
- RequestUriProcessor.cs
- GeneralTransform2DTo3DTo2D.cs
- DocumentPage.cs
- ObjectItemAttributeAssemblyLoader.cs
- UnsafeNativeMethods.cs
- FrameworkRichTextComposition.cs
- SecurityProtocolCorrelationState.cs
- ImageFormat.cs
- XmlUnspecifiedAttribute.cs
- ItemDragEvent.cs
- ExpressionTextBox.xaml.cs
- IdnMapping.cs
- ThousandthOfEmRealPoints.cs
- HierarchicalDataSourceControl.cs
- DataGridTablesFactory.cs
- FrameworkElementAutomationPeer.cs
- CompiledQueryCacheEntry.cs
- ResourceDictionary.cs
- ClientCultureInfo.cs
- SendKeys.cs
- DataGridViewCellCancelEventArgs.cs
- ResXResourceReader.cs
- MenuItem.cs
- QueryRewriter.cs
- CharacterMetrics.cs
- SymLanguageType.cs
- M3DUtil.cs
- CompletedAsyncResult.cs
- Annotation.cs
- BuilderInfo.cs
- ItemsControlAutomationPeer.cs
- JavaScriptSerializer.cs
- TextAdaptor.cs
- MetadataFile.cs
- TdsValueSetter.cs
- ToolStripOverflowButton.cs
- InputLanguageCollection.cs
- TableSectionStyle.cs
- webproxy.cs
- OdbcConnectionStringbuilder.cs
- _Win32.cs
- CodeTryCatchFinallyStatement.cs
- DictionaryBase.cs
- VersionConverter.cs
- PopOutPanel.cs
- AnimationLayer.cs
- EventHandlerList.cs
- MimeTypeAttribute.cs
- CustomValidator.cs
- GotoExpression.cs
- Drawing.cs
- ListItemCollection.cs
- StateDesigner.Layouts.cs
- SecurityChannel.cs
- ITextView.cs
- ContextMenuService.cs
- xsdvalidator.cs
- SingleObjectCollection.cs
- FixedPosition.cs
- NestPullup.cs
- SecurityValidationBehavior.cs
- SoapSchemaMember.cs
- BasicCellRelation.cs
- JsonServiceDocumentSerializer.cs