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
- StorageFunctionMapping.cs
- EditorPartChrome.cs
- AppDomainInfo.cs
- RequiredAttributeAttribute.cs
- TablePattern.cs
- COAUTHIDENTITY.cs
- PtsCache.cs
- WindowsAuthenticationEventArgs.cs
- LongValidatorAttribute.cs
- DataView.cs
- SqlGenericUtil.cs
- Substitution.cs
- LayoutInformation.cs
- DeploymentExceptionMapper.cs
- FixedSOMGroup.cs
- ValueUtilsSmi.cs
- GraphicsState.cs
- PictureBox.cs
- HashAlgorithm.cs
- CompilerHelpers.cs
- BitmapEffectGroup.cs
- XPathDocumentBuilder.cs
- ServicePoint.cs
- ApplyTemplatesAction.cs
- FtpWebResponse.cs
- CodeValidator.cs
- TreeViewItemAutomationPeer.cs
- DBCSCodePageEncoding.cs
- UnsafeNativeMethods.cs
- Figure.cs
- xml.cs
- TranslateTransform.cs
- Pkcs9Attribute.cs
- SoapSchemaMember.cs
- ClusterSafeNativeMethods.cs
- XmlBaseReader.cs
- HtmlTernaryTree.cs
- KeyValueConfigurationElement.cs
- ClaimSet.cs
- ReflectionServiceProvider.cs
- ContentType.cs
- WorkflowQueueInfo.cs
- PagesSection.cs
- CatalogZoneBase.cs
- WebPartEditorOkVerb.cs
- DbMetaDataColumnNames.cs
- ViewStateException.cs
- HighlightVisual.cs
- CapabilitiesUse.cs
- CqlParserHelpers.cs
- XsltContext.cs
- FlowPosition.cs
- DBProviderConfigurationHandler.cs
- __ConsoleStream.cs
- CheckBoxBaseAdapter.cs
- CodeLabeledStatement.cs
- PenCursorManager.cs
- SecurityStandardsManager.cs
- datacache.cs
- CompilerCollection.cs
- FlowDocument.cs
- TabPageDesigner.cs
- SystemUnicastIPAddressInformation.cs
- DataSourceHelper.cs
- StatusBar.cs
- FreeFormDragDropManager.cs
- recordstatescratchpad.cs
- BoundingRectTracker.cs
- XmlSchemaAttributeGroupRef.cs
- SettingsPropertyIsReadOnlyException.cs
- XamlToRtfWriter.cs
- ListSourceHelper.cs
- DateTimePicker.cs
- ConfigurationStrings.cs
- WebPartMinimizeVerb.cs
- XmlSerializerFactory.cs
- EncoderParameter.cs
- TimeSpanMinutesConverter.cs
- BuildProviderAppliesToAttribute.cs
- ThreadExceptionEvent.cs
- SliderAutomationPeer.cs
- SymLanguageType.cs
- OleDbWrapper.cs
- ToolstripProfessionalRenderer.cs
- MissingMethodException.cs
- DesignerActionListCollection.cs
- BaseDataList.cs
- QueryCacheEntry.cs
- VisualStateChangedEventArgs.cs
- ObjectDataSourceEventArgs.cs
- CapabilitiesState.cs
- SimpleBitVector32.cs
- FloaterParagraph.cs
- CustomAttributeBuilder.cs
- IntSecurity.cs
- EntityDataSourceValidationException.cs
- PackageRelationshipSelector.cs
- DataColumnPropertyDescriptor.cs
- SqlEnums.cs
- BackgroundWorker.cs