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
- Literal.cs
- NonVisualControlAttribute.cs
- ServiceBuildProvider.cs
- ToolStripGrip.cs
- BitmapEffectDrawingContent.cs
- RepeatButtonAutomationPeer.cs
- SettingsPropertyIsReadOnlyException.cs
- ManualResetEvent.cs
- DropShadowBitmapEffect.cs
- ToolStripCollectionEditor.cs
- WindowsStatic.cs
- KerberosSecurityTokenAuthenticator.cs
- TreeIterator.cs
- StyleConverter.cs
- DbConnectionPool.cs
- Vertex.cs
- IProvider.cs
- ImpersonateTokenRef.cs
- RSAOAEPKeyExchangeFormatter.cs
- DocumentOrderComparer.cs
- SoapSchemaImporter.cs
- RuleSettings.cs
- ThemeableAttribute.cs
- DbConnectionHelper.cs
- WSMessageEncoding.cs
- FixedLineResult.cs
- SessionIDManager.cs
- XhtmlBasicPanelAdapter.cs
- DecoderBestFitFallback.cs
- documentsequencetextcontainer.cs
- odbcmetadatacollectionnames.cs
- translator.cs
- LateBoundBitmapDecoder.cs
- ControlValuePropertyAttribute.cs
- BaseDataList.cs
- ImageIndexEditor.cs
- CanExecuteRoutedEventArgs.cs
- HttpCacheVary.cs
- XamlSerializerUtil.cs
- IgnorePropertiesAttribute.cs
- SqlCaseSimplifier.cs
- XmlBoundElement.cs
- ContextInformation.cs
- ListView.cs
- ThumbAutomationPeer.cs
- OutOfProcStateClientManager.cs
- DataListItemEventArgs.cs
- CssTextWriter.cs
- ContainerSelectorActiveEvent.cs
- GetRecipientRequest.cs
- RSAOAEPKeyExchangeFormatter.cs
- ListenerSessionConnection.cs
- NetworkInformationException.cs
- ListSourceHelper.cs
- TemplatedAdorner.cs
- Timer.cs
- DoubleLink.cs
- Cloud.cs
- PropertyRef.cs
- ChildrenQuery.cs
- TemplatePartAttribute.cs
- ApplicationServicesHostFactory.cs
- Validator.cs
- DrawingBrush.cs
- MenuItemCollection.cs
- Stackframe.cs
- EntityUtil.cs
- RuntimeVariablesExpression.cs
- EntityContainerRelationshipSet.cs
- EmptyEnumerable.cs
- SelectedCellsCollection.cs
- TextTreeDeleteContentUndoUnit.cs
- UpdateExpressionVisitor.cs
- Collection.cs
- M3DUtil.cs
- PopupRoot.cs
- CodeTypeOfExpression.cs
- GeometryValueSerializer.cs
- Mutex.cs
- Pen.cs
- ZipIOBlockManager.cs
- WsdlWriter.cs
- RecognizerBase.cs
- SatelliteContractVersionAttribute.cs
- XmlRawWriter.cs
- BamlMapTable.cs
- Attributes.cs
- PopupRootAutomationPeer.cs
- FileDialogPermission.cs
- ListViewInsertedEventArgs.cs
- DataTemplateSelector.cs
- TypeNameConverter.cs
- GridViewDeletedEventArgs.cs
- SplineKeyFrames.cs
- SqlDelegatedTransaction.cs
- XamlRtfConverter.cs
- DbParameterCollection.cs
- DtrList.cs
- TokenizerHelper.cs
- SchemaElementDecl.cs