Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcReferenceCollection.cs / 1305376 / 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
- HttpApplicationFactory.cs
- TreeWalkHelper.cs
- DataBindingHandlerAttribute.cs
- Point.cs
- CompiledIdentityConstraint.cs
- CreatingCookieEventArgs.cs
- Speller.cs
- KeyFrames.cs
- ReflectionTypeLoadException.cs
- XmlArrayItemAttribute.cs
- WebOperationContext.cs
- TileBrush.cs
- PauseStoryboard.cs
- Tag.cs
- SkinIDTypeConverter.cs
- AutomationEventArgs.cs
- GridViewColumn.cs
- HttpFileCollectionWrapper.cs
- CodeRegionDirective.cs
- XPathBinder.cs
- XsltLoader.cs
- AstNode.cs
- ImageCodecInfo.cs
- ExpressionBuilder.cs
- FixedHyperLink.cs
- QilVisitor.cs
- GeometryModel3D.cs
- BamlLocalizationDictionary.cs
- SocketPermission.cs
- StaticSiteMapProvider.cs
- StackSpiller.Generated.cs
- NonPrimarySelectionGlyph.cs
- ActivationServices.cs
- TemplatedAdorner.cs
- SmiSettersStream.cs
- ConfigurationErrorsException.cs
- Point4D.cs
- DataControlCommands.cs
- Gdiplus.cs
- SoapEnumAttribute.cs
- SplashScreen.cs
- PrePrepareMethodAttribute.cs
- Light.cs
- ProfileSettings.cs
- DataTableNewRowEvent.cs
- TabControlDesigner.cs
- ResizingMessageFilter.cs
- EntityDataSourceDataSelectionPanel.cs
- DeploymentSection.cs
- Vector3DAnimation.cs
- TabPage.cs
- AppearanceEditorPart.cs
- LogWriteRestartAreaAsyncResult.cs
- HtmlGenericControl.cs
- XMLDiffLoader.cs
- HtmlInputFile.cs
- listviewsubitemcollectioneditor.cs
- KnownAssemblyEntry.cs
- GenericAuthenticationEventArgs.cs
- TextEffect.cs
- XmlSchemaChoice.cs
- RealProxy.cs
- DbProviderFactories.cs
- HttpListener.cs
- SymDocumentType.cs
- BoundField.cs
- HttpWebRequest.cs
- Matrix.cs
- userdatakeys.cs
- DigitShape.cs
- MsmqTransportSecurityElement.cs
- HttpResponse.cs
- IItemProperties.cs
- TargetControlTypeAttribute.cs
- RowUpdatedEventArgs.cs
- BinaryMethodMessage.cs
- IdentityNotMappedException.cs
- DesignerActionMethodItem.cs
- LineServicesCallbacks.cs
- DesignTimeVisibleAttribute.cs
- OLEDB_Util.cs
- TagElement.cs
- TemporaryBitmapFile.cs
- DataAdapter.cs
- DataFormats.cs
- FileChangesMonitor.cs
- ServiceNotStartedException.cs
- DependentList.cs
- Group.cs
- IntranetCredentialPolicy.cs
- FontStretch.cs
- WindowsAuthenticationModule.cs
- TextDataBindingHandler.cs
- XmlDataImplementation.cs
- LabelLiteral.cs
- ConstraintConverter.cs
- SystemResources.cs
- IndexOutOfRangeException.cs
- externdll.cs
- QueueProcessor.cs