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
- StateManagedCollection.cs
- RC2CryptoServiceProvider.cs
- COSERVERINFO.cs
- Stylesheet.cs
- HMAC.cs
- DockAndAnchorLayout.cs
- MimeImporter.cs
- PixelFormat.cs
- HttpWebResponse.cs
- UnsafeNativeMethodsMilCoreApi.cs
- indexingfiltermarshaler.cs
- AsyncPostBackErrorEventArgs.cs
- TimelineCollection.cs
- securitymgrsite.cs
- AttributeProviderAttribute.cs
- EventPrivateKey.cs
- TdsParserHelperClasses.cs
- StaticExtension.cs
- DataMisalignedException.cs
- VerticalAlignConverter.cs
- BaseTreeIterator.cs
- ReferencedCollectionType.cs
- RangeBaseAutomationPeer.cs
- WindowsSysHeader.cs
- URLMembershipCondition.cs
- brushes.cs
- LocationUpdates.cs
- BadImageFormatException.cs
- HandlerMappingMemo.cs
- OleDbPermission.cs
- WebPartEditorCancelVerb.cs
- DesignTimeParseData.cs
- Rotation3D.cs
- DefaultValueConverter.cs
- Endpoint.cs
- NamedObject.cs
- GlobalizationAssembly.cs
- mediaeventshelper.cs
- InputManager.cs
- IconConverter.cs
- SelectionPatternIdentifiers.cs
- FileUtil.cs
- IPipelineRuntime.cs
- PageThemeBuildProvider.cs
- HashMembershipCondition.cs
- WebPartExportVerb.cs
- MatrixTransform3D.cs
- UInt64Converter.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- CodeAttributeDeclaration.cs
- ToolStripSeparatorRenderEventArgs.cs
- EasingKeyFrames.cs
- DesignerCategoryAttribute.cs
- CompatibleIComparer.cs
- DoubleLinkList.cs
- TcpClientSocketManager.cs
- NumberSubstitution.cs
- MaterialCollection.cs
- RowToFieldTransformer.cs
- UdpUtility.cs
- DataSet.cs
- ManagedIStream.cs
- ActivityExecutionContext.cs
- ImageField.cs
- XmlUtf8RawTextWriter.cs
- PopOutPanel.cs
- LineSegment.cs
- PrimitiveXmlSerializers.cs
- TableHeaderCell.cs
- XmlCustomFormatter.cs
- DelegatingTypeDescriptionProvider.cs
- EditorServiceContext.cs
- SqlClientWrapperSmiStream.cs
- InkCanvas.cs
- CultureSpecificStringDictionary.cs
- RuntimeConfigurationRecord.cs
- TypeDependencyAttribute.cs
- SafeMarshalContext.cs
- xsdvalidator.cs
- LinqDataSourceHelper.cs
- ShaderEffect.cs
- UriTemplateLiteralQueryValue.cs
- BrowserTree.cs
- ActionFrame.cs
- OpenFileDialog.cs
- GridViewSelectEventArgs.cs
- CommonDialog.cs
- RemoveStoryboard.cs
- WebResourceAttribute.cs
- Compiler.cs
- Line.cs
- ReflectEventDescriptor.cs
- PeerTransportListenAddressValidator.cs
- XPathEmptyIterator.cs
- SpeechRecognizer.cs
- SAPICategories.cs
- RecordsAffectedEventArgs.cs
- RegularExpressionValidator.cs
- SelectionList.cs
- WindowsFormsHostPropertyMap.cs