Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcReferenceCollection.cs / 1305376 / 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
- ObjectListFieldCollection.cs
- IisTraceWebEventProvider.cs
- DBBindings.cs
- WpfKnownType.cs
- PngBitmapEncoder.cs
- CAGDesigner.cs
- ToolStripContainer.cs
- DataGridColumnStyleMappingNameEditor.cs
- ObjectParameter.cs
- XmlMembersMapping.cs
- SortDescriptionCollection.cs
- Statements.cs
- EventKeyword.cs
- ScrollChrome.cs
- DecoderExceptionFallback.cs
- ConfigsHelper.cs
- GraphicsState.cs
- ErrorHandlingReceiver.cs
- OutputCacheSection.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- InternalCache.cs
- SqlTriggerContext.cs
- NumberSubstitution.cs
- TextEditorParagraphs.cs
- ExtenderControl.cs
- SQLInt32Storage.cs
- VisualStyleTypesAndProperties.cs
- PingOptions.cs
- WebConfigurationHost.cs
- XmlDocument.cs
- HashAlgorithm.cs
- PlainXmlWriter.cs
- NewExpression.cs
- SymbolEqualComparer.cs
- WorkflowControlClient.cs
- SpotLight.cs
- OleDbConnectionFactory.cs
- PeerDuplexChannelListener.cs
- DataGridItemEventArgs.cs
- SqlFactory.cs
- COM2IProvidePropertyBuilderHandler.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ToolboxItemWrapper.cs
- XmlIlTypeHelper.cs
- SessionChannels.cs
- SeverityFilter.cs
- ValidatorCompatibilityHelper.cs
- FilteredDataSetHelper.cs
- DataGridRelationshipRow.cs
- SqlFactory.cs
- StatusBarPanel.cs
- CachedPathData.cs
- TableLayoutStyle.cs
- SqlDataSourceCache.cs
- login.cs
- ReleaseInstanceMode.cs
- LabelLiteral.cs
- XmlSchemas.cs
- ChildrenQuery.cs
- CallContext.cs
- UnmanagedHandle.cs
- UriGenerator.cs
- DataGridViewRowsAddedEventArgs.cs
- StdValidatorsAndConverters.cs
- JumpTask.cs
- UntrustedRecipientException.cs
- DataGridViewCheckBoxCell.cs
- GridViewColumnCollection.cs
- EffectiveValueEntry.cs
- EntityDataSourceViewSchema.cs
- NgenServicingAttributes.cs
- IList.cs
- EdmSchemaError.cs
- UpdateExpressionVisitor.cs
- WindowsIdentity.cs
- SafeArrayRankMismatchException.cs
- FollowerQueueCreator.cs
- GridView.cs
- FontUnit.cs
- AsymmetricKeyExchangeDeformatter.cs
- ContractTypeNameCollection.cs
- Filter.cs
- KnownIds.cs
- NativeRecognizer.cs
- TextBoxBase.cs
- FrameworkContentElementAutomationPeer.cs
- AuthenticationSection.cs
- ParameterExpression.cs
- Vector3DCollectionConverter.cs
- AnnotationAuthorChangedEventArgs.cs
- HttpContextBase.cs
- RuleSetDialog.cs
- ChangesetResponse.cs
- Timeline.cs
- ListViewItem.cs
- HtmlValidatorAdapter.cs
- Crypto.cs
- IndexerReference.cs
- DesignerHelpers.cs
- SplineQuaternionKeyFrame.cs