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
- DocumentXmlWriter.cs
- DesignTimeSiteMapProvider.cs
- RegistryConfigurationProvider.cs
- Point3DKeyFrameCollection.cs
- MetadataItemEmitter.cs
- LogExtentCollection.cs
- AnimationStorage.cs
- MbpInfo.cs
- SerializerDescriptor.cs
- IndividualDeviceConfig.cs
- NativeMethods.cs
- CodeDelegateCreateExpression.cs
- XamlClipboardData.cs
- CustomMenuItemCollection.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ManualResetEvent.cs
- TransformerInfoCollection.cs
- InputLanguageSource.cs
- PropertyDescriptorComparer.cs
- ModelTreeEnumerator.cs
- FileRecordSequenceHelper.cs
- WebConfigurationHost.cs
- DataGridViewColumnCollection.cs
- WindowsClientElement.cs
- CqlGenerator.cs
- FloatUtil.cs
- SchemaNames.cs
- ResXDataNode.cs
- EntityTransaction.cs
- SqlBuffer.cs
- SemaphoreFullException.cs
- VisualBrush.cs
- DataSourceControlBuilder.cs
- BamlRecordWriter.cs
- ListViewCancelEventArgs.cs
- Configuration.cs
- HashAlgorithm.cs
- ObjectDataSourceFilteringEventArgs.cs
- DefaultAuthorizationContext.cs
- SafeProcessHandle.cs
- ComContractElement.cs
- PageStatePersister.cs
- WebResponse.cs
- DispatcherObject.cs
- HTMLTagNameToTypeMapper.cs
- WorkflowPageSetupDialog.cs
- FacetEnabledSchemaElement.cs
- TemplateBamlTreeBuilder.cs
- AggregateNode.cs
- TargetPerspective.cs
- InkPresenterAutomationPeer.cs
- RichTextBoxConstants.cs
- Size.cs
- StylusCaptureWithinProperty.cs
- SecurityUtils.cs
- QilPatternFactory.cs
- TraceHandler.cs
- MsmqTransportReceiveParameters.cs
- AsyncStreamReader.cs
- SetMemberBinder.cs
- StreamGeometryContext.cs
- StringFunctions.cs
- EnumCodeDomSerializer.cs
- Attachment.cs
- SurrogateChar.cs
- TabControl.cs
- Merger.cs
- WindowsTokenRoleProvider.cs
- MetadataPropertyAttribute.cs
- EnumerableRowCollection.cs
- CompModSwitches.cs
- Variant.cs
- Polygon.cs
- CultureSpecificCharacterBufferRange.cs
- GenerateTemporaryTargetAssembly.cs
- SmtpException.cs
- Label.cs
- EntityTemplateFactory.cs
- WindowsUpDown.cs
- WebPartDisplayModeEventArgs.cs
- Calendar.cs
- CommandEventArgs.cs
- ChannelFactoryRefCache.cs
- Selection.cs
- ElapsedEventArgs.cs
- ContainerUtilities.cs
- AddressHeader.cs
- EdmRelationshipRoleAttribute.cs
- QueryOperationResponseOfT.cs
- SslStream.cs
- WebServiceClientProxyGenerator.cs
- XamlTreeBuilderBamlRecordWriter.cs
- HandoffBehavior.cs
- connectionpool.cs
- SmiConnection.cs
- NoPersistProperty.cs
- Equal.cs
- WebChannelFactory.cs
- XmlEnumAttribute.cs
- ModelFunctionTypeElement.cs