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
- HttpRuntimeSection.cs
- DatagridviewDisplayedBandsData.cs
- ClientBuildManager.cs
- SQLByteStorage.cs
- OdbcCommand.cs
- WindowsListViewGroupHelper.cs
- BindingMAnagerBase.cs
- CodeNamespaceCollection.cs
- InputReportEventArgs.cs
- SqlXmlStorage.cs
- SerializationAttributes.cs
- ContextMarshalException.cs
- RouteItem.cs
- DesigntimeLicenseContextSerializer.cs
- LowerCaseStringConverter.cs
- ClockController.cs
- RootAction.cs
- Shared.cs
- GeometryGroup.cs
- XmlIlGenerator.cs
- pingexception.cs
- ListCollectionView.cs
- CompareInfo.cs
- NameTable.cs
- ModelUtilities.cs
- Pen.cs
- WpfKnownMemberInvoker.cs
- MatrixAnimationBase.cs
- ItemContainerProviderWrapper.cs
- IdnMapping.cs
- XmlConverter.cs
- DataGridLengthConverter.cs
- RawMouseInputReport.cs
- SqlCommand.cs
- HtmlControlAdapter.cs
- SoapEnvelopeProcessingElement.cs
- GetPageNumberCompletedEventArgs.cs
- MatrixTransform3D.cs
- WebPartEventArgs.cs
- NodeLabelEditEvent.cs
- ZipPackagePart.cs
- SaveFileDialog.cs
- SignatureHelper.cs
- FontUnitConverter.cs
- Tracer.cs
- XmlNullResolver.cs
- AddInStore.cs
- CallId.cs
- PublishLicense.cs
- ProfilePropertyNameValidator.cs
- ObjectStorage.cs
- CaseInsensitiveHashCodeProvider.cs
- _LoggingObject.cs
- AutomationProperties.cs
- GenerateScriptTypeAttribute.cs
- UpdatePanel.cs
- XpsSerializationException.cs
- infer.cs
- BamlResourceDeserializer.cs
- HitTestResult.cs
- ProcessingInstructionAction.cs
- ConfigurationManagerHelperFactory.cs
- ConsoleKeyInfo.cs
- ApplicationInterop.cs
- StringFreezingAttribute.cs
- BitArray.cs
- ClusterSafeNativeMethods.cs
- ProxyFragment.cs
- Model3D.cs
- MenuItemStyleCollection.cs
- ToolStripItemRenderEventArgs.cs
- DefaultPrintController.cs
- ModuleConfigurationInfo.cs
- CellTreeNodeVisitors.cs
- DiscoveryClientOutputChannel.cs
- IntranetCredentialPolicy.cs
- DisplayInformation.cs
- StickyNoteContentControl.cs
- UiaCoreApi.cs
- OleDbEnumerator.cs
- SolidColorBrush.cs
- CallSite.cs
- ExpressionParser.cs
- TextServicesCompartmentEventSink.cs
- ImageList.cs
- ContentOperations.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- EntityCommandCompilationException.cs
- CapabilitiesSection.cs
- ExpressionEditor.cs
- EditCommandColumn.cs
- URLIdentityPermission.cs
- HtmlFormParameterWriter.cs
- Point.cs
- HttpRawResponse.cs
- HandlerBase.cs
- DataGridTextBoxColumn.cs
- KeyEvent.cs
- SortKey.cs
- DetailsViewDeleteEventArgs.cs