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
- designeractionbehavior.cs
- InvalidOperationException.cs
- SqlServer2KCompatibilityCheck.cs
- SmtpReplyReader.cs
- ParallelActivityDesigner.cs
- Vector3DAnimationUsingKeyFrames.cs
- SmtpDateTime.cs
- TextFormatterImp.cs
- FillErrorEventArgs.cs
- securitycriticaldataClass.cs
- Int16Converter.cs
- MenuItem.cs
- ResolveNameEventArgs.cs
- UnsafeNativeMethods.cs
- HTMLTagNameToTypeMapper.cs
- SoapReflectionImporter.cs
- ArgumentNullException.cs
- StyleModeStack.cs
- ProtocolViolationException.cs
- AnnotationMap.cs
- DataMemberFieldConverter.cs
- SharedStream.cs
- HierarchicalDataTemplate.cs
- CommandLibraryHelper.cs
- PropertyPathConverter.cs
- GridViewColumnHeaderAutomationPeer.cs
- SmtpClient.cs
- QueryableDataSourceHelper.cs
- IntSecurity.cs
- FixedSOMTableRow.cs
- GeneralTransform2DTo3DTo2D.cs
- RuleSettings.cs
- EncoderParameters.cs
- CodePrimitiveExpression.cs
- ObjectDataSourceFilteringEventArgs.cs
- DependencyPropertyDescriptor.cs
- IsolatedStorageFilePermission.cs
- CustomErrorsSection.cs
- BatchParser.cs
- Vector3D.cs
- ServiceOperationParameter.cs
- InplaceBitmapMetadataWriter.cs
- MouseGestureValueSerializer.cs
- DiagnosticsConfigurationHandler.cs
- RegexGroupCollection.cs
- SamlDelegatingWriter.cs
- diagnosticsswitches.cs
- SevenBitStream.cs
- PrintPreviewDialog.cs
- OverflowException.cs
- NullReferenceException.cs
- ObjectToken.cs
- BindingRestrictions.cs
- ValidatingReaderNodeData.cs
- OperatingSystem.cs
- _NestedSingleAsyncResult.cs
- TextTreeUndo.cs
- XPathException.cs
- ResourceDescriptionAttribute.cs
- ResourceSet.cs
- ObjectStateEntry.cs
- DataGridColumnStyleMappingNameEditor.cs
- LinkButton.cs
- RowVisual.cs
- SqlVisitor.cs
- ThicknessAnimation.cs
- SecurityAccessDeniedException.cs
- SoapCommonClasses.cs
- ArgumentValue.cs
- RichTextBoxAutomationPeer.cs
- ViewStateAttachedPropertyFeature.cs
- Label.cs
- CompositeKey.cs
- WebHeaderCollection.cs
- OutputWindow.cs
- IsolatedStorage.cs
- AccessorTable.cs
- RuntimeVariableList.cs
- DbProviderFactories.cs
- ValidationHelper.cs
- EdmPropertyAttribute.cs
- TableParaClient.cs
- StaticResourceExtension.cs
- DataGridViewColumnHeaderCell.cs
- DispatcherProcessingDisabled.cs
- ControlDesignerState.cs
- Cloud.cs
- CursorConverter.cs
- DynamicMethod.cs
- PerfCounterSection.cs
- ColorDialog.cs
- ImageKeyConverter.cs
- ExceptionTrace.cs
- PerformanceCounterManager.cs
- GridSplitterAutomationPeer.cs
- TableLayoutRowStyleCollection.cs
- WebPartCatalogCloseVerb.cs
- ManipulationDevice.cs
- ToolStripGrip.cs
- DataGridClipboardCellContent.cs