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
- PageTheme.cs
- StateRuntime.cs
- TransformCryptoHandle.cs
- ByteConverter.cs
- OdbcEnvironmentHandle.cs
- InvalidateEvent.cs
- MarshalByValueComponent.cs
- EncoderExceptionFallback.cs
- X509SubjectKeyIdentifierClause.cs
- GeneralTransform3DTo2DTo3D.cs
- DataServiceQueryOfT.cs
- SingleBodyParameterMessageFormatter.cs
- AdapterDictionary.cs
- HttpApplicationFactory.cs
- XmlNodeChangedEventManager.cs
- ErrorInfoXmlDocument.cs
- ConstructorExpr.cs
- NativeDirectoryServicesQueryAPIs.cs
- EmptyControlCollection.cs
- HebrewCalendar.cs
- ProxyElement.cs
- Root.cs
- ElementFactory.cs
- PersistChildrenAttribute.cs
- XmlCharCheckingWriter.cs
- MouseButton.cs
- RoleGroup.cs
- TreeViewItemAutomationPeer.cs
- ContentPosition.cs
- FileSystemInfo.cs
- PasswordRecovery.cs
- ProtocolElement.cs
- _AuthenticationState.cs
- _AutoWebProxyScriptEngine.cs
- TableStyle.cs
- PassportIdentity.cs
- ResponseBodyWriter.cs
- ContactManager.cs
- DataControlField.cs
- DayRenderEvent.cs
- XmlMapping.cs
- PassportAuthenticationEventArgs.cs
- FormatterConverter.cs
- SymbolTable.cs
- Configuration.cs
- SamlAuthorizationDecisionStatement.cs
- DesignTable.cs
- ReflectionHelper.cs
- WebPartConnectionCollection.cs
- EventWaitHandleSecurity.cs
- HttpStreamMessage.cs
- COM2FontConverter.cs
- ClientType.cs
- StandardCommands.cs
- EUCJPEncoding.cs
- SettingsPropertyCollection.cs
- CancelEventArgs.cs
- GeneralTransformGroup.cs
- Section.cs
- DataBindingsDialog.cs
- TypeValidationEventArgs.cs
- WebColorConverter.cs
- MessageQueueCriteria.cs
- StatusBarPanelClickEvent.cs
- XmlUTF8TextWriter.cs
- HostAdapter.cs
- WaitingCursor.cs
- CryptoProvider.cs
- HtmlInputFile.cs
- DetailsViewUpdateEventArgs.cs
- WebBrowserBase.cs
- DataGridViewCellCancelEventArgs.cs
- FunctionParameter.cs
- TreeView.cs
- TypedReference.cs
- ScaleTransform.cs
- Trace.cs
- LinqDataSourceView.cs
- AlternateView.cs
- Simplifier.cs
- GC.cs
- BaseTemplateParser.cs
- Thumb.cs
- DataExpression.cs
- IConvertible.cs
- LogEntryHeaderDeserializer.cs
- SafeFindHandle.cs
- RepeatEnumerable.cs
- MessagePropertyDescriptionCollection.cs
- UnionCodeGroup.cs
- Expression.DebuggerProxy.cs
- OTFRasterizer.cs
- ControlUtil.cs
- PositiveTimeSpanValidatorAttribute.cs
- HtmlElementEventArgs.cs
- StrokeNodeOperations2.cs
- LinqDataSourceValidationException.cs
- DPAPIProtectedConfigurationProvider.cs
- GrammarBuilder.cs
- BaseTemplateBuildProvider.cs