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
- LoaderAllocator.cs
- RowToParametersTransformer.cs
- SqlDataSourceCommandEventArgs.cs
- InvalidCastException.cs
- SqlInfoMessageEvent.cs
- PrincipalPermission.cs
- GlyphElement.cs
- DrawListViewSubItemEventArgs.cs
- SerializationException.cs
- AppDomainAttributes.cs
- SqlConnectionFactory.cs
- ChineseLunisolarCalendar.cs
- Win32.cs
- PathNode.cs
- DataGridViewImageCell.cs
- DesignerActionHeaderItem.cs
- WsatEtwTraceListener.cs
- PenLineCapValidation.cs
- ClientSettingsProvider.cs
- MimeMapping.cs
- SystemColors.cs
- LocalizeDesigner.cs
- TextCharacters.cs
- Group.cs
- BCryptSafeHandles.cs
- MarkupExtensionReturnTypeAttribute.cs
- XsdDuration.cs
- SaveFileDialog.cs
- LinkGrep.cs
- StructuralObject.cs
- TransactionState.cs
- DbSourceCommand.cs
- PropertyCollection.cs
- IsolatedStorageFileStream.cs
- TextShapeableCharacters.cs
- ObjectFullSpanRewriter.cs
- CustomTokenProvider.cs
- CommonDialog.cs
- ValueExpressions.cs
- EndpointAddress10.cs
- QilGenerator.cs
- TextStore.cs
- AstNode.cs
- Size.cs
- OdbcErrorCollection.cs
- TraceProvider.cs
- BindUriHelper.cs
- PerformanceCounterPermissionAttribute.cs
- Light.cs
- DataGridViewCellEventArgs.cs
- VirtualDirectoryMappingCollection.cs
- MatrixStack.cs
- xdrvalidator.cs
- CompilerGlobalScopeAttribute.cs
- TemplatePropertyEntry.cs
- TreeView.cs
- AutomationElementCollection.cs
- CopyNamespacesAction.cs
- XmlElement.cs
- MessageSmuggler.cs
- ConstraintEnumerator.cs
- HtmlInputButton.cs
- RemoteX509AsymmetricSecurityKey.cs
- DataGridState.cs
- SQLInt16Storage.cs
- MultipleViewPattern.cs
- EnumMemberAttribute.cs
- DataServiceQueryException.cs
- XmlSchemaCompilationSettings.cs
- AppDomainFactory.cs
- FieldNameLookup.cs
- TextBlockAutomationPeer.cs
- KeyTimeConverter.cs
- Underline.cs
- GridSplitterAutomationPeer.cs
- CategoryNameCollection.cs
- DataGridViewAddColumnDialog.cs
- EventProvider.cs
- CreateUserWizardStep.cs
- DefaultAssemblyResolver.cs
- MediaEntryAttribute.cs
- XamlContextStack.cs
- DropDownHolder.cs
- SiteMembershipCondition.cs
- NotifyCollectionChangedEventArgs.cs
- HandledMouseEvent.cs
- UnknownBitmapEncoder.cs
- TraceEventCache.cs
- Config.cs
- PackagePart.cs
- InvalidPropValue.cs
- ArrayTypeMismatchException.cs
- ScriptReference.cs
- LinqTreeNodeEvaluator.cs
- BufferedGraphicsManager.cs
- HierarchicalDataBoundControl.cs
- LocatorBase.cs
- BitStream.cs
- DispatchWrapper.cs
- HyperLinkStyle.cs