Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / OleDb / OleDbReferenceCollection.cs / 1305376 / OleDbReferenceCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; using System.Runtime.InteropServices; sealed internal class OleDbReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Canceling = -1; internal const int CommandTag = 1; internal const int DataReaderTag = 2; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { bool canceling = (Canceling == message); if (CommandTag == tag) { ((OleDbCommand) value).CloseCommandFromConnection(canceling); } else if (DataReaderTag == tag) { ((OleDbDataReader) value).CloseReaderFromConnection(canceling); } else { Debug.Assert(false, "shouldn't be here"); } 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. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.OleDb { using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; using System.Runtime.InteropServices; sealed internal class OleDbReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Canceling = -1; internal const int CommandTag = 1; internal const int DataReaderTag = 2; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { bool canceling = (Canceling == message); if (CommandTag == tag) { ((OleDbCommand) value).CloseCommandFromConnection(canceling); } else if (DataReaderTag == tag) { ((OleDbDataReader) value).CloseReaderFromConnection(canceling); } else { Debug.Assert(false, "shouldn't be here"); } 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
- SqlDependency.cs
- TextDecorationLocationValidation.cs
- StrokeNodeOperations.cs
- ConfigurationSchemaErrors.cs
- DataSourceCache.cs
- RoleService.cs
- HistoryEventArgs.cs
- TransformerTypeCollection.cs
- ContextInformation.cs
- OpCodes.cs
- CmsUtils.cs
- GZipDecoder.cs
- ConfigurationSectionHelper.cs
- RequestQueryProcessor.cs
- UInt64Converter.cs
- shaper.cs
- Utils.cs
- AsymmetricSignatureFormatter.cs
- FullTrustAssemblyCollection.cs
- SqlNodeTypeOperators.cs
- PlainXmlWriter.cs
- CompositeActivityTypeDescriptor.cs
- EdmPropertyAttribute.cs
- ScrollPattern.cs
- SerialReceived.cs
- SafeFileMappingHandle.cs
- SystemNetHelpers.cs
- securestring.cs
- PackageStore.cs
- DefaultPropertiesToSend.cs
- StandardCommands.cs
- CodeTypeMemberCollection.cs
- SiteMap.cs
- ErrorProvider.cs
- Viewport3DVisual.cs
- ApplicationSecurityManager.cs
- ConfigurationSection.cs
- WindowsMenu.cs
- EntityDataSourceConfigureObjectContext.cs
- MonitoringDescriptionAttribute.cs
- DependsOnAttribute.cs
- QuaternionConverter.cs
- DbConvert.cs
- ContainerParagraph.cs
- QuaternionRotation3D.cs
- Pair.cs
- ConnectionStringsExpressionBuilder.cs
- DataControlFieldHeaderCell.cs
- HtmlFormParameterWriter.cs
- WebBrowserBase.cs
- WindowsToolbarItemAsMenuItem.cs
- KnownBoxes.cs
- ThemeInfoAttribute.cs
- SystemUnicastIPAddressInformation.cs
- HiddenField.cs
- ParserContext.cs
- GridItem.cs
- RoutingEndpointTrait.cs
- DataSetViewSchema.cs
- XPathBinder.cs
- SyndicationElementExtensionCollection.cs
- DecimalConverter.cs
- SystemDropShadowChrome.cs
- PhysicalAddress.cs
- LowerCaseStringConverter.cs
- Model3D.cs
- ValueTypeFixupInfo.cs
- SchemaNames.cs
- XmlParserContext.cs
- WebBrowserEvent.cs
- UIElementPropertyUndoUnit.cs
- QilFactory.cs
- ArcSegment.cs
- Size3DConverter.cs
- CompModHelpers.cs
- TableItemStyle.cs
- _StreamFramer.cs
- SBCSCodePageEncoding.cs
- XmlFormatMapping.cs
- ItemsPresenter.cs
- GlobalProxySelection.cs
- ManualResetEventSlim.cs
- ClientOptions.cs
- TextEditorMouse.cs
- BamlStream.cs
- CroppedBitmap.cs
- BamlCollectionHolder.cs
- odbcmetadatafactory.cs
- SimpleType.cs
- ViewSimplifier.cs
- COM2FontConverter.cs
- PageBuildProvider.cs
- FrameworkElement.cs
- OperandQuery.cs
- _ProxyRegBlob.cs
- CommonObjectSecurity.cs
- Italic.cs
- ActivitySurrogate.cs
- WebColorConverter.cs
- JsonFormatReaderGenerator.cs