Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / OleDb / OleDbReferenceCollection.cs / 1 / 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
- ConfigurationStrings.cs
- RemoteWebConfigurationHostStream.cs
- DataGridPagerStyle.cs
- DataGrid.cs
- ClassImporter.cs
- translator.cs
- FlowDocumentReader.cs
- UntypedNullExpression.cs
- Separator.cs
- CopyNamespacesAction.cs
- SubMenuStyleCollectionEditor.cs
- CharKeyFrameCollection.cs
- DispatchChannelSink.cs
- WebConfigurationManager.cs
- GeometryHitTestParameters.cs
- UnknownBitmapDecoder.cs
- AstTree.cs
- invalidudtexception.cs
- DbProviderFactories.cs
- ClientConfigPaths.cs
- ButtonField.cs
- FunctionMappingTranslator.cs
- XmlDataContract.cs
- ToolStripPanelDesigner.cs
- XmlSchemaCollection.cs
- TraceFilter.cs
- ConfigurationSchemaErrors.cs
- FrameworkContentElement.cs
- MsmqIntegrationMessageProperty.cs
- FormViewRow.cs
- DrawingContextFlattener.cs
- EntityDataSourceWrapperCollection.cs
- X509Extension.cs
- JsonByteArrayDataContract.cs
- ToolStrip.cs
- DataSourceIDConverter.cs
- ApplicationSecurityInfo.cs
- FunctionCommandText.cs
- GenericRootAutomationPeer.cs
- HwndSubclass.cs
- CodeCommentStatementCollection.cs
- HtmlImageAdapter.cs
- SuppressMergeCheckAttribute.cs
- PreservationFileWriter.cs
- TreeNodeCollection.cs
- TreeViewBindingsEditor.cs
- HtmlElement.cs
- DropShadowEffect.cs
- RijndaelManagedTransform.cs
- LineSegment.cs
- Listbox.cs
- HwndSubclass.cs
- SqlCaseSimplifier.cs
- ProcessProtocolHandler.cs
- SoapObjectInfo.cs
- ApplicationInterop.cs
- EntityDataSourceEntityTypeFilterItem.cs
- Pen.cs
- TagPrefixInfo.cs
- OutputCache.cs
- HtmlInputButton.cs
- GlyphRunDrawing.cs
- XmlSchemaAttributeGroupRef.cs
- EditorOptionAttribute.cs
- ParameterCollection.cs
- DbConnectionPool.cs
- RuntimeEnvironment.cs
- ClientSponsor.cs
- ReadContentAsBinaryHelper.cs
- HashMembershipCondition.cs
- Console.cs
- PartitionResolver.cs
- AssemblyAttributesGoHere.cs
- MarshalByRefObject.cs
- XamlTypeMapper.cs
- TextChangedEventArgs.cs
- ASCIIEncoding.cs
- InputLangChangeRequestEvent.cs
- DataSourceCache.cs
- SafeEventLogWriteHandle.cs
- PointCollection.cs
- ProcessInputEventArgs.cs
- WindowsGraphicsWrapper.cs
- VirtualizingPanel.cs
- WhitespaceRule.cs
- IdleTimeoutMonitor.cs
- DrawItemEvent.cs
- FormsAuthenticationUserCollection.cs
- AxHost.cs
- DesignerInterfaces.cs
- XmlReader.cs
- ColorConvertedBitmapExtension.cs
- DrawingImage.cs
- DictionaryEntry.cs
- ObjectItemConventionAssemblyLoader.cs
- PropertyValueUIItem.cs
- PropertyCondition.cs
- ServiceOperationInfoTypeConverter.cs
- StyleCollectionEditor.cs
- SecurityContextTokenCache.cs