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
- SqlUdtInfo.cs
- Application.cs
- SqlConnection.cs
- ResourceDisplayNameAttribute.cs
- IntSecurity.cs
- FileChangeNotifier.cs
- AdornerHitTestResult.cs
- ObjectItemCachedAssemblyLoader.cs
- MemberRelationshipService.cs
- GenericTransactionFlowAttribute.cs
- MemoryMappedFileSecurity.cs
- base64Transforms.cs
- ApplicationHost.cs
- GridEntry.cs
- CompoundFileIOPermission.cs
- DataBoundControl.cs
- EFDataModelProvider.cs
- Track.cs
- CodeTypeMemberCollection.cs
- cryptoapiTransform.cs
- XmlSchemaAny.cs
- CompilerGlobalScopeAttribute.cs
- MiniModule.cs
- ListItemConverter.cs
- UnsafeNativeMethods.cs
- StatusStrip.cs
- GridItemCollection.cs
- SetMemberBinder.cs
- RNGCryptoServiceProvider.cs
- ObjectDataSourceFilteringEventArgs.cs
- ImageBrush.cs
- ToolConsole.cs
- WebPartZone.cs
- TearOffProxy.cs
- HttpContextServiceHost.cs
- HttpListenerException.cs
- ControlCollection.cs
- DataSourceBooleanViewSchemaConverter.cs
- WMIInterop.cs
- ListViewInsertEventArgs.cs
- CharConverter.cs
- Triplet.cs
- ThemeableAttribute.cs
- DebugHandleTracker.cs
- WebConvert.cs
- GeneralTransform.cs
- ThrowHelper.cs
- ActiveXSerializer.cs
- GridViewColumnHeader.cs
- Properties.cs
- ClientRolePrincipal.cs
- CapacityStreamGeometryContext.cs
- BehaviorEditorPart.cs
- TdsParameterSetter.cs
- AlphaSortedEnumConverter.cs
- WebSysDefaultValueAttribute.cs
- DragDrop.cs
- TransformDescriptor.cs
- IBuiltInEvidence.cs
- XmlDocumentFragment.cs
- ExecutedRoutedEventArgs.cs
- ComponentFactoryHelpers.cs
- GridViewSelectEventArgs.cs
- StaticSiteMapProvider.cs
- XamlWriter.cs
- Activity.cs
- ScrollBar.cs
- ColumnClickEvent.cs
- OracleConnectionStringBuilder.cs
- ParameterElement.cs
- WindowsSecurityTokenAuthenticator.cs
- Transform.cs
- ForeignConstraint.cs
- precedingquery.cs
- FixedPageAutomationPeer.cs
- EtwTrace.cs
- _NestedMultipleAsyncResult.cs
- Transform3D.cs
- QueryTreeBuilder.cs
- GetPageNumberCompletedEventArgs.cs
- BrushMappingModeValidation.cs
- PropertyItemInternal.cs
- Int16Converter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- EFDataModelProvider.cs
- EntityCommandExecutionException.cs
- ContextStack.cs
- TrackBarRenderer.cs
- cookiecollection.cs
- ProcessHostMapPath.cs
- ReflectionHelper.cs
- FillRuleValidation.cs
- MexBindingBindingCollectionElement.cs
- TemplateControlParser.cs
- RawTextInputReport.cs
- DateTimeConverter2.cs
- ColorAnimationUsingKeyFrames.cs
- InputLanguageProfileNotifySink.cs
- BitmapMetadataBlob.cs
- CompatibleComparer.cs