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
- SafeNativeMemoryHandle.cs
- ResourceReader.cs
- SystemIdentity.cs
- DSACryptoServiceProvider.cs
- DataGridViewTextBoxCell.cs
- ButtonBase.cs
- BuildProviderUtils.cs
- ResourceManager.cs
- SpellerError.cs
- AssemblyInfo.cs
- InstanceData.cs
- RedirectionProxy.cs
- _DisconnectOverlappedAsyncResult.cs
- SecurityTokenProvider.cs
- ShapeTypeface.cs
- DataSourceControlBuilder.cs
- CompilerTypeWithParams.cs
- SqlInfoMessageEvent.cs
- Vector.cs
- TypedReference.cs
- DataGridViewRowsAddedEventArgs.cs
- MetadataArtifactLoaderCompositeFile.cs
- ISO2022Encoding.cs
- DataGridViewCellCancelEventArgs.cs
- HttpDictionary.cs
- WebPartsPersonalizationAuthorization.cs
- StateBag.cs
- DataGridViewCellValidatingEventArgs.cs
- followingsibling.cs
- OdbcUtils.cs
- MissingMethodException.cs
- SafePointer.cs
- SafeMarshalContext.cs
- PKCS1MaskGenerationMethod.cs
- SizeAnimation.cs
- DefaultEventAttribute.cs
- X509CertificateChain.cs
- EncodingInfo.cs
- CompensatableTransactionScopeActivityDesigner.cs
- AnimationStorage.cs
- DataControlPagerLinkButton.cs
- ReversePositionQuery.cs
- AsymmetricSecurityBindingElement.cs
- XmlSchemaException.cs
- SystemException.cs
- ArrayItemValue.cs
- TextEditorTables.cs
- ChannelAcceptor.cs
- SessionStateSection.cs
- VolatileResourceManager.cs
- StyleBamlTreeBuilder.cs
- RuntimeConfig.cs
- Overlapped.cs
- ResXResourceReader.cs
- Int64KeyFrameCollection.cs
- PageCatalogPart.cs
- SolidColorBrush.cs
- SerializeAbsoluteContext.cs
- BrushMappingModeValidation.cs
- QilParameter.cs
- GestureRecognitionResult.cs
- StatusBarDesigner.cs
- SchemaMapping.cs
- DesignerValidatorAdapter.cs
- FaultPropagationRecord.cs
- CharacterString.cs
- ManipulationDelta.cs
- ImpersonateTokenRef.cs
- UserControl.cs
- ScriptResourceInfo.cs
- FileUtil.cs
- DataControlCommands.cs
- XappLauncher.cs
- DbSetClause.cs
- MenuAutoFormat.cs
- UIPermission.cs
- FormViewPagerRow.cs
- ReadWriteSpinLock.cs
- Vector3DKeyFrameCollection.cs
- LinearKeyFrames.cs
- PasswordTextNavigator.cs
- SqlDataSource.cs
- MutableAssemblyCacheEntry.cs
- ThicknessKeyFrameCollection.cs
- BitmapEffectInput.cs
- OleDragDropHandler.cs
- EncoderExceptionFallback.cs
- WindowsAuthenticationEventArgs.cs
- Run.cs
- ClassHandlersStore.cs
- xmlfixedPageInfo.cs
- VoiceChangeEventArgs.cs
- OperationCanceledException.cs
- TemplateBindingExpressionConverter.cs
- HierarchicalDataSourceControl.cs
- ByteStream.cs
- StylusTip.cs
- DataGridViewRowStateChangedEventArgs.cs
- CodeMethodReturnStatement.cs
- AutomationProperties.cs