Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- wgx_exports.cs
- PropertyInformation.cs
- HealthMonitoringSection.cs
- ResourceWriter.cs
- Compensation.cs
- CommandCollectionEditor.cs
- DeferredReference.cs
- PreparingEnlistment.cs
- Walker.cs
- AuthorizationRuleCollection.cs
- ListBox.cs
- Query.cs
- InheritanceService.cs
- ControlPropertyNameConverter.cs
- SwitchLevelAttribute.cs
- TreeWalker.cs
- KeysConverter.cs
- IndependentlyAnimatedPropertyMetadata.cs
- TabControl.cs
- XamlStyleSerializer.cs
- documentsequencetextcontainer.cs
- SecurityUtils.cs
- ParameterCollection.cs
- XPathQueryGenerator.cs
- InputProcessorProfilesLoader.cs
- SessionEndingEventArgs.cs
- BidPrivateBase.cs
- OneToOneMappingSerializer.cs
- NonSerializedAttribute.cs
- Win32Native.cs
- FontStyle.cs
- SafeNativeMethods.cs
- SystemIPGlobalProperties.cs
- regiisutil.cs
- GestureRecognitionResult.cs
- RSAPKCS1SignatureFormatter.cs
- TemplateEditingService.cs
- DynamicResourceExtensionConverter.cs
- IteratorDescriptor.cs
- SeekStoryboard.cs
- newinstructionaction.cs
- FontDialog.cs
- MouseEventArgs.cs
- ExpressionTable.cs
- WindowsListBox.cs
- DefaultTextStore.cs
- LoginCancelEventArgs.cs
- ToolStripComboBox.cs
- ManipulationCompletedEventArgs.cs
- AbstractSvcMapFileLoader.cs
- BinHexEncoder.cs
- ExpressionsCollectionEditor.cs
- UInt16.cs
- TagMapInfo.cs
- ExpressionList.cs
- SemaphoreFullException.cs
- MaskedTextBoxTextEditorDropDown.cs
- ProjectionNode.cs
- PrimitiveList.cs
- AnimationTimeline.cs
- PreDigestedSignedInfo.cs
- UTF7Encoding.cs
- ProcessHostServerConfig.cs
- GlyphsSerializer.cs
- DataGridViewCellStyleConverter.cs
- ButtonPopupAdapter.cs
- Certificate.cs
- DataKeyPropertyAttribute.cs
- BasicCommandTreeVisitor.cs
- XmlBinaryWriter.cs
- TrustLevelCollection.cs
- Lazy.cs
- PageContent.cs
- TraceData.cs
- Missing.cs
- C14NUtil.cs
- TextOnlyOutput.cs
- RegexInterpreter.cs
- OleCmdHelper.cs
- Thread.cs
- VirtualDirectoryMappingCollection.cs
- MarkupObject.cs
- MonthChangedEventArgs.cs
- SinglePageViewer.cs
- ImmComposition.cs
- X509CertificateCollection.cs
- XmlSubtreeReader.cs
- MetadataArtifactLoaderCompositeFile.cs
- Brush.cs
- DelegateSerializationHolder.cs
- TrackingMemoryStream.cs
- TemplateBindingExpressionConverter.cs
- BufferedGraphics.cs
- BaseDataList.cs
- SyndicationSerializer.cs
- LicenseContext.cs
- UpdatePanelTriggerCollection.cs
- Fonts.cs
- OutputCacheProfile.cs
- RadioButtonList.cs