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
- ButtonRenderer.cs
- ContextMenu.cs
- LabelEditEvent.cs
- ActionFrame.cs
- DataControlFieldHeaderCell.cs
- Size3DConverter.cs
- ScalarRestriction.cs
- EncryptedPackage.cs
- RuntimeConfigLKG.cs
- DatagridviewDisplayedBandsData.cs
- GridViewRowPresenterBase.cs
- PolicyVersion.cs
- ToolboxDataAttribute.cs
- MarkupCompilePass1.cs
- DefaultMemberAttribute.cs
- BamlRecordWriter.cs
- IncrementalHitTester.cs
- MouseEvent.cs
- ValueHandle.cs
- PropertyChangedEventManager.cs
- TraceListener.cs
- SmiEventSink_DeferedProcessing.cs
- MonitorWrapper.cs
- ThreadAbortException.cs
- CheckBox.cs
- SymmetricKey.cs
- WebBrowserHelper.cs
- AdornerLayer.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- AuthenticationSection.cs
- GradientStopCollection.cs
- BackoffTimeoutHelper.cs
- ActivityCodeDomSerializer.cs
- RequestBringIntoViewEventArgs.cs
- AuthenticationService.cs
- MsdtcWrapper.cs
- PeerInvitationResponse.cs
- AsnEncodedData.cs
- RegexStringValidatorAttribute.cs
- Missing.cs
- GridViewCancelEditEventArgs.cs
- Light.cs
- HttpClientCredentialType.cs
- AttributeCollection.cs
- CollectionView.cs
- ModuleConfigurationInfo.cs
- FontFamily.cs
- SocketException.cs
- Boolean.cs
- ISAPIApplicationHost.cs
- _IPv6Address.cs
- XPathPatternBuilder.cs
- SizeKeyFrameCollection.cs
- ExtensionWindowResizeGrip.cs
- UnionCqlBlock.cs
- BatchStream.cs
- WebInvokeAttribute.cs
- BufferBuilder.cs
- XpsFilter.cs
- RoleManagerModule.cs
- FormView.cs
- StylusDevice.cs
- Accessors.cs
- Array.cs
- SqlCacheDependencyDatabase.cs
- SqlEnums.cs
- ToolStripItemDesigner.cs
- DynamicControl.cs
- MultiDataTrigger.cs
- WebServiceEnumData.cs
- ScrollItemPatternIdentifiers.cs
- BitmapEffectrendercontext.cs
- ServiceBehaviorElementCollection.cs
- ClientTargetSection.cs
- WebBrowserUriTypeConverter.cs
- StyleBamlRecordReader.cs
- ReflectionTypeLoadException.cs
- SQLDateTime.cs
- BitmapEncoder.cs
- XmlCustomFormatter.cs
- FolderBrowserDialog.cs
- Application.cs
- Stacktrace.cs
- WSFederationHttpBindingCollectionElement.cs
- ProcessStartInfo.cs
- FixedSOMContainer.cs
- TaiwanCalendar.cs
- OverlappedContext.cs
- PreviewKeyDownEventArgs.cs
- FilteredReadOnlyMetadataCollection.cs
- XmlSerializableWriter.cs
- DispatchWrapper.cs
- EntityViewGenerator.cs
- PagerSettings.cs
- Label.cs
- ScrollProperties.cs
- QueryIntervalOp.cs
- BindingWorker.cs
- ValidationEventArgs.cs
- XNameTypeConverter.cs