Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- BmpBitmapEncoder.cs
- KeyGestureConverter.cs
- TraceHandler.cs
- ScopelessEnumAttribute.cs
- ContextInformation.cs
- RequestNavigateEventArgs.cs
- HttpCachePolicyWrapper.cs
- ActivityCompletionCallbackWrapper.cs
- ConfigurationValidatorAttribute.cs
- WindowsListViewScroll.cs
- OleDbDataAdapter.cs
- PrimitiveDataContract.cs
- Action.cs
- ParseHttpDate.cs
- DbModificationClause.cs
- BitmapFrameDecode.cs
- IteratorAsyncResult.cs
- RepeaterItem.cs
- ClientSettings.cs
- CultureNotFoundException.cs
- ValidatedControlConverter.cs
- EnumerableRowCollection.cs
- Grant.cs
- XmlUtil.cs
- __ConsoleStream.cs
- XmlRawWriterWrapper.cs
- ExcludeFromCodeCoverageAttribute.cs
- ObjectDisposedException.cs
- RequestCachePolicyConverter.cs
- PreDigestedSignedInfo.cs
- UnsafeNativeMethods.cs
- WorkflowPageSetupDialog.cs
- glyphs.cs
- ProviderUtil.cs
- RuleSettings.cs
- SingleTagSectionHandler.cs
- StyleTypedPropertyAttribute.cs
- FileCodeGroup.cs
- AppearanceEditorPart.cs
- TypeConverterValueSerializer.cs
- TemplateKey.cs
- WindowsStartMenu.cs
- Int16Converter.cs
- OutOfMemoryException.cs
- PolyQuadraticBezierSegment.cs
- CodeComment.cs
- MatrixAnimationBase.cs
- OptimizedTemplateContent.cs
- FrameworkReadOnlyPropertyMetadata.cs
- Vector3DCollectionValueSerializer.cs
- BitmapDecoder.cs
- Int32CollectionConverter.cs
- DisplayToken.cs
- FileSystemWatcher.cs
- DefaultShape.cs
- DeobfuscatingStream.cs
- CodeRemoveEventStatement.cs
- NamespaceQuery.cs
- LookupBindingPropertiesAttribute.cs
- TaiwanLunisolarCalendar.cs
- TemplateBindingExpression.cs
- PointLightBase.cs
- ItemsControlAutomationPeer.cs
- CompiledIdentityConstraint.cs
- AssemblyGen.cs
- StreamGeometry.cs
- OletxDependentTransaction.cs
- HttpListenerElement.cs
- ConnectionDemuxer.cs
- TextContainerChangeEventArgs.cs
- ReadOnlyDataSource.cs
- DataIdProcessor.cs
- HitTestParameters3D.cs
- MetadataArtifactLoader.cs
- Section.cs
- TimelineCollection.cs
- HtmlInputPassword.cs
- QilExpression.cs
- MenuCommands.cs
- PageTheme.cs
- WinEventWrap.cs
- XmlSchemaDocumentation.cs
- InputElement.cs
- SingleObjectCollection.cs
- PostBackOptions.cs
- HistoryEventArgs.cs
- SafeEventLogWriteHandle.cs
- HttpServerVarsCollection.cs
- EnumerableRowCollection.cs
- Socket.cs
- PrivacyNoticeElement.cs
- TransportContext.cs
- VirtualDirectoryMappingCollection.cs
- FacetChecker.cs
- MetadataUtilsSmi.cs
- PaginationProgressEventArgs.cs
- DataControlHelper.cs
- CalculatedColumn.cs
- HashHelper.cs
- PermissionListSet.cs