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
- GroupBoxRenderer.cs
- VisualBrush.cs
- SQLDecimal.cs
- EventLog.cs
- XmlReflectionImporter.cs
- TraceHandlerErrorFormatter.cs
- UntrustedRecipientException.cs
- DataGridCommandEventArgs.cs
- DataTransferEventArgs.cs
- NumericExpr.cs
- Automation.cs
- Exceptions.cs
- ImmutableCollection.cs
- ContainsSearchOperator.cs
- SemaphoreSecurity.cs
- BufferModesCollection.cs
- XmlSchemaInclude.cs
- CompositeDesignerAccessibleObject.cs
- EntityDataSourceDataSelection.cs
- GACMembershipCondition.cs
- XmlNavigatorStack.cs
- HitTestDrawingContextWalker.cs
- TemplateControl.cs
- TypedElement.cs
- BindStream.cs
- Container.cs
- MemoryRecordBuffer.cs
- DataSourceView.cs
- PagerSettings.cs
- RenderTargetBitmap.cs
- SequentialWorkflowHeaderFooter.cs
- ContainsRowNumberChecker.cs
- DesignerWidgets.cs
- SwitchLevelAttribute.cs
- HierarchicalDataBoundControlAdapter.cs
- DataBindingCollection.cs
- TextPattern.cs
- CodeExporter.cs
- SmiContextFactory.cs
- DateTimeSerializationSection.cs
- CompositeActivityTypeDescriptor.cs
- SqlClientPermission.cs
- LayoutDump.cs
- AuthorizationSection.cs
- TagPrefixCollection.cs
- UmAlQuraCalendar.cs
- RunInstallerAttribute.cs
- ManagementQuery.cs
- RijndaelManagedTransform.cs
- FontUnit.cs
- WorkflowTransactionService.cs
- TypeBuilderInstantiation.cs
- Style.cs
- DBDataPermissionAttribute.cs
- _NegotiateClient.cs
- AppDomainEvidenceFactory.cs
- unsafeIndexingFilterStream.cs
- ListBox.cs
- CfgParser.cs
- QuestionEventArgs.cs
- DragDeltaEventArgs.cs
- GlyphRun.cs
- ConstructorNeedsTagAttribute.cs
- NullReferenceException.cs
- ValuePattern.cs
- ObjectTag.cs
- AttributeCollection.cs
- CreateUserWizardStep.cs
- ObjectListSelectEventArgs.cs
- DoubleKeyFrameCollection.cs
- XMLSchema.cs
- DrawItemEvent.cs
- MetadataAssemblyHelper.cs
- WorkflowCommandExtensionItem.cs
- FormViewUpdatedEventArgs.cs
- UriExt.cs
- InvalidContentTypeException.cs
- PeerInvitationResponse.cs
- DefaultValidator.cs
- HandlerBase.cs
- RtfControls.cs
- VSWCFServiceContractGenerator.cs
- PointAnimation.cs
- CompositeCollectionView.cs
- formatter.cs
- PersistChildrenAttribute.cs
- PrivilegeNotHeldException.cs
- MarkupCompilePass2.cs
- SqlMethodAttribute.cs
- AliasGenerator.cs
- RawKeyboardInputReport.cs
- SplashScreenNativeMethods.cs
- EventLogSession.cs
- TaskDesigner.cs
- WindowsStatic.cs
- RelationalExpressions.cs
- Style.cs
- XmlNullResolver.cs
- ClientApiGenerator.cs
- ProjectionAnalyzer.cs