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
- GrammarBuilder.cs
- DataRowComparer.cs
- ReadOnlyDataSource.cs
- TextElementCollection.cs
- SqlParameterCollection.cs
- DynamicValidatorEventArgs.cs
- EditorZone.cs
- InplaceBitmapMetadataWriter.cs
- InkCanvasAutomationPeer.cs
- DragEvent.cs
- EventSinkActivity.cs
- MethodBuilder.cs
- EntityFunctions.cs
- SqlDataSourceFilteringEventArgs.cs
- QueryStringConverter.cs
- TagNameToTypeMapper.cs
- HtmlTableCell.cs
- TextTreeExtractElementUndoUnit.cs
- HeaderCollection.cs
- IgnoreDeviceFilterElement.cs
- RuleSetDialog.Designer.cs
- selecteditemcollection.cs
- CompiledRegexRunnerFactory.cs
- GroupQuery.cs
- ConfigurationSectionGroup.cs
- CalendarDayButton.cs
- CombinedGeometry.cs
- PeerCollaborationPermission.cs
- StylusButton.cs
- FixedSOMLineCollection.cs
- XmlSchemaDatatype.cs
- SqlRetyper.cs
- XmlNodeWriter.cs
- RunWorkerCompletedEventArgs.cs
- MessageQueuePermissionEntry.cs
- DataGridViewComponentPropertyGridSite.cs
- ApplicationBuildProvider.cs
- FlowLayoutSettings.cs
- TableLayoutColumnStyleCollection.cs
- DesignerActionService.cs
- ContainerParaClient.cs
- DeploymentSectionCache.cs
- StrongNameKeyPair.cs
- SudsParser.cs
- TextBoxBase.cs
- TextReader.cs
- AdditionalEntityFunctions.cs
- EntitySetBaseCollection.cs
- PropertyChangedEventArgs.cs
- NullReferenceException.cs
- clipboard.cs
- SiteMapProvider.cs
- BitmapEffectRenderDataResource.cs
- ObjectNotFoundException.cs
- TabControlEvent.cs
- datacache.cs
- DefaultProxySection.cs
- Stylesheet.cs
- SizeConverter.cs
- FontClient.cs
- InputBuffer.cs
- SqlRemoveConstantOrderBy.cs
- RoamingStoreFileUtility.cs
- DetailsViewUpdateEventArgs.cs
- ToolboxDataAttribute.cs
- DataGridViewButtonCell.cs
- RuntimeIdentifierPropertyAttribute.cs
- Misc.cs
- ExtentJoinTreeNode.cs
- NameValuePermission.cs
- ElementsClipboardData.cs
- HybridDictionary.cs
- InvalidFilterCriteriaException.cs
- sqlstateclientmanager.cs
- ListItemsCollectionEditor.cs
- TableCellCollection.cs
- BuilderInfo.cs
- References.cs
- WindowsAuthenticationEventArgs.cs
- PasswordBox.cs
- ExtentKey.cs
- UIElement.cs
- NamedPermissionSet.cs
- AttachedAnnotationChangedEventArgs.cs
- EntryPointNotFoundException.cs
- ProtocolsConfigurationHandler.cs
- WeakReferenceList.cs
- WinCategoryAttribute.cs
- DataGridAddNewRow.cs
- DbMetaDataCollectionNames.cs
- SqlWebEventProvider.cs
- NetSectionGroup.cs
- sqlnorm.cs
- brushes.cs
- CustomErrorsSection.cs
- SecureConversationServiceCredential.cs
- FixUpCollection.cs
- EncoderExceptionFallback.cs
- ListChangedEventArgs.cs
- ellipse.cs