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
- WebPartManagerInternals.cs
- ContextProperty.cs
- MultipartIdentifier.cs
- RangeBaseAutomationPeer.cs
- PropertyDescriptorGridEntry.cs
- ListViewInsertionMark.cs
- SharedPersonalizationStateInfo.cs
- DropTarget.cs
- _ConnectOverlappedAsyncResult.cs
- StringComparer.cs
- CatalogZoneBase.cs
- MembershipPasswordException.cs
- Int32AnimationUsingKeyFrames.cs
- TextContainerHelper.cs
- HttpChannelHelper.cs
- WizardPanelChangingEventArgs.cs
- MenuItemStyle.cs
- SessionParameter.cs
- Fx.cs
- CommonProperties.cs
- ObjectRef.cs
- ScriptDescriptor.cs
- TypeReference.cs
- MetafileHeader.cs
- ConnectionConsumerAttribute.cs
- SecureStringHasher.cs
- TaiwanCalendar.cs
- IpcChannelHelper.cs
- Transform3DGroup.cs
- SynchronizationContext.cs
- DataMisalignedException.cs
- SqlDataSourceAdvancedOptionsForm.cs
- OpacityConverter.cs
- ObjectViewEntityCollectionData.cs
- SafeThemeHandle.cs
- TailPinnedEventArgs.cs
- SchemaNotation.cs
- RoleService.cs
- MultiPageTextView.cs
- Mutex.cs
- ThemeDirectoryCompiler.cs
- ContractCodeDomInfo.cs
- FormatSettings.cs
- PersonalizableTypeEntry.cs
- RequestSecurityTokenForGetBrowserToken.cs
- _SpnDictionary.cs
- DtdParser.cs
- TlsnegoTokenProvider.cs
- DataSourceView.cs
- ListSurrogate.cs
- CommonObjectSecurity.cs
- MethodCallTranslator.cs
- SystemPens.cs
- ColorAnimationBase.cs
- Debug.cs
- WizardPanel.cs
- DeviceContext.cs
- DynamicDataExtensions.cs
- TextSelectionHelper.cs
- WebColorConverter.cs
- DetailsViewPagerRow.cs
- UnmanagedMemoryStreamWrapper.cs
- InternalsVisibleToAttribute.cs
- TableRow.cs
- BamlLocalizableResource.cs
- NetSectionGroup.cs
- ObfuscateAssemblyAttribute.cs
- SpellerHighlightLayer.cs
- ECDiffieHellmanCngPublicKey.cs
- CustomAttributeBuilder.cs
- RotateTransform3D.cs
- DependencyPropertyHelper.cs
- TableRowGroup.cs
- ContextMenuAutomationPeer.cs
- PrinterResolution.cs
- QilNode.cs
- Terminate.cs
- WebPartMinimizeVerb.cs
- EventItfInfo.cs
- Permission.cs
- DataGridViewTextBoxCell.cs
- Geometry3D.cs
- HtmlContainerControl.cs
- TraceSection.cs
- FormViewCommandEventArgs.cs
- RewritingValidator.cs
- TabletCollection.cs
- DecoderNLS.cs
- SqlPersonalizationProvider.cs
- WebControlAdapter.cs
- Sequence.cs
- SoapClientProtocol.cs
- OleDbRowUpdatingEvent.cs
- FrameAutomationPeer.cs
- ApplicationServiceHelper.cs
- RawStylusInput.cs
- ToggleProviderWrapper.cs
- CaseCqlBlock.cs
- ExpressionQuoter.cs
- DbConnectionPoolIdentity.cs