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
- DataGridViewColumnConverter.cs
- ConfigurationValues.cs
- SessionStateContainer.cs
- StringBuilder.cs
- BindingExpressionUncommonField.cs
- ProfileEventArgs.cs
- NullReferenceException.cs
- PerformanceCounterPermissionEntryCollection.cs
- SelectionItemProviderWrapper.cs
- AssemblyUtil.cs
- PageHandlerFactory.cs
- NextPreviousPagerField.cs
- Stacktrace.cs
- XmlDocumentType.cs
- EntityDataSourceSelectingEventArgs.cs
- SqlXml.cs
- StrokeRenderer.cs
- HttpHandlerAction.cs
- MetadataItemCollectionFactory.cs
- BeginStoryboard.cs
- HiddenFieldPageStatePersister.cs
- SynchronizationLockException.cs
- GridViewRowEventArgs.cs
- ModelEditingScope.cs
- PropertyIDSet.cs
- WebBrowserProgressChangedEventHandler.cs
- codemethodreferenceexpression.cs
- Help.cs
- StreamResourceInfo.cs
- MessagePropertyAttribute.cs
- SecurityValidationBehavior.cs
- HtmlMobileTextWriter.cs
- RNGCryptoServiceProvider.cs
- WSSecurityXXX2005.cs
- xml.cs
- HuffCodec.cs
- StringToken.cs
- RichTextBox.cs
- Convert.cs
- HostingEnvironmentSection.cs
- HttpDebugHandler.cs
- RenameRuleObjectDialog.cs
- OrElse.cs
- SafeLibraryHandle.cs
- CheckBoxStandardAdapter.cs
- DeleteBookmarkScope.cs
- ProgressBar.cs
- BrowserCapabilitiesFactory.cs
- ModuleBuilder.cs
- FormatterServicesNoSerializableCheck.cs
- XmlSchemaAttributeGroup.cs
- FileEnumerator.cs
- ResourceType.cs
- SequenceDesigner.cs
- WindowPatternIdentifiers.cs
- Propagator.Evaluator.cs
- Privilege.cs
- SafeTimerHandle.cs
- QuarticEase.cs
- WorkBatch.cs
- ApplicationServiceHelper.cs
- BindingMAnagerBase.cs
- ListControlConvertEventArgs.cs
- ConnectionsZone.cs
- ThemeInfoAttribute.cs
- EnumerableRowCollection.cs
- ImportCatalogPart.cs
- PointAnimationUsingPath.cs
- ClrProviderManifest.cs
- AssociationTypeEmitter.cs
- Vector3D.cs
- MruCache.cs
- TextEffect.cs
- ExpressionCopier.cs
- Misc.cs
- NameObjectCollectionBase.cs
- BindingBase.cs
- ObsoleteAttribute.cs
- EntitySetBaseCollection.cs
- TTSEngineTypes.cs
- BooleanAnimationUsingKeyFrames.cs
- XPathSelectionIterator.cs
- AnnotationObservableCollection.cs
- UriScheme.cs
- InvokeSchedule.cs
- PropertyPathWorker.cs
- RepeaterItemCollection.cs
- Int16Animation.cs
- Matrix.cs
- IncrementalHitTester.cs
- SafeReadContext.cs
- ConsumerConnectionPointCollection.cs
- ThreadExceptionEvent.cs
- BaseDataBoundControl.cs
- ProcessHostMapPath.cs
- CacheMemory.cs
- HierarchicalDataSourceControl.cs
- CompositeDataBoundControl.cs
- VerificationAttribute.cs
- PrefixQName.cs