Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcReferenceCollection.cs / 1305376 / 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
- SystemIcmpV4Statistics.cs
- ConfigXmlSignificantWhitespace.cs
- AssemblyCollection.cs
- ThreadStartException.cs
- KeyboardEventArgs.cs
- HideDisabledControlAdapter.cs
- KeyMatchBuilder.cs
- EndpointFilterProvider.cs
- EllipseGeometry.cs
- CharEnumerator.cs
- CryptoApi.cs
- Rule.cs
- RegexNode.cs
- SqlDataRecord.cs
- SafeProcessHandle.cs
- VariantWrapper.cs
- ConfigXmlText.cs
- DataReaderContainer.cs
- Buffer.cs
- CompilerCollection.cs
- MemoryFailPoint.cs
- ClientRoleProvider.cs
- Frame.cs
- TemplatePagerField.cs
- ApplicationContext.cs
- ToolStripDesignerAvailabilityAttribute.cs
- CryptographicAttribute.cs
- objectresult_tresulttype.cs
- PrintDialog.cs
- X509ChainElement.cs
- HtmlInputFile.cs
- SizeKeyFrameCollection.cs
- _Connection.cs
- TCEAdapterGenerator.cs
- SaveFileDialog.cs
- SqlParameterCollection.cs
- UnionCodeGroup.cs
- TransformPatternIdentifiers.cs
- TextOptionsInternal.cs
- ListViewGroupConverter.cs
- DataSourceSelectArguments.cs
- ViewCellSlot.cs
- NotifyParentPropertyAttribute.cs
- RecoverInstanceLocksCommand.cs
- SettingsAttributes.cs
- TimeSpanOrInfiniteValidator.cs
- DbResourceAllocator.cs
- StringUtil.cs
- SortAction.cs
- _Events.cs
- X509Certificate2.cs
- _Rfc2616CacheValidators.cs
- LoginUtil.cs
- ToolboxComponentsCreatedEventArgs.cs
- DelegatedStream.cs
- AssociationProvider.cs
- LookupBindingPropertiesAttribute.cs
- WebMessageFormatHelper.cs
- GlobalAllocSafeHandle.cs
- TextPatternIdentifiers.cs
- TextEditorCopyPaste.cs
- SamlNameIdentifierClaimResource.cs
- QueryInterceptorAttribute.cs
- TextParagraphCache.cs
- EditingCommands.cs
- XslException.cs
- MessageQueueInstaller.cs
- Repeater.cs
- UpdateManifestForBrowserApplication.cs
- HelpInfo.cs
- embossbitmapeffect.cs
- BindableTemplateBuilder.cs
- DataServiceException.cs
- DataServiceResponse.cs
- PolyBezierSegment.cs
- VideoDrawing.cs
- Decoder.cs
- ZipIOExtraFieldPaddingElement.cs
- GorillaCodec.cs
- Pair.cs
- Button.cs
- SystemFonts.cs
- Select.cs
- EvidenceTypeDescriptor.cs
- __ConsoleStream.cs
- PersonalizationEntry.cs
- DataGridViewColumnCollectionDialog.cs
- TextProviderWrapper.cs
- RecordBuilder.cs
- AppDomainProtocolHandler.cs
- CommandHelpers.cs
- Crypto.cs
- SQLInt32Storage.cs
- ValueTable.cs
- ConfigViewGenerator.cs
- HttpListenerPrefixCollection.cs
- RectKeyFrameCollection.cs
- OracleString.cs
- DesignerImageAdapter.cs
- BitmapEffectState.cs