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
- SystemSounds.cs
- EntityModelSchemaGenerator.cs
- Point4DConverter.cs
- SafeArchiveContext.cs
- MenuAutoFormat.cs
- HMACSHA256.cs
- SecurityResources.cs
- QilValidationVisitor.cs
- InvalidateEvent.cs
- EmptyStringExpandableObjectConverter.cs
- MissingMethodException.cs
- TypeConverterHelper.cs
- SingletonChannelAcceptor.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ListBoxAutomationPeer.cs
- PersonalizableTypeEntry.cs
- EntityContainerEntitySet.cs
- ValidationHelper.cs
- EnterpriseServicesHelper.cs
- SiteIdentityPermission.cs
- MessageEncodingBindingElementImporter.cs
- Viewport3DAutomationPeer.cs
- PropertyOrder.cs
- ParameterModifier.cs
- HostingPreferredMapPath.cs
- StateFinalizationActivity.cs
- ResourceIDHelper.cs
- Win32.cs
- PointLight.cs
- EntityViewGenerator.cs
- FragmentQueryProcessor.cs
- UnitySerializationHolder.cs
- NetTcpBinding.cs
- _LazyAsyncResult.cs
- GuidTagList.cs
- DefaultMemberAttribute.cs
- SevenBitStream.cs
- ResourcePool.cs
- OleDbStruct.cs
- CompModHelpers.cs
- ProcessModelSection.cs
- AlphabeticalEnumConverter.cs
- DiffuseMaterial.cs
- XamlWriterExtensions.cs
- StringFreezingAttribute.cs
- CodeCommentStatement.cs
- AVElementHelper.cs
- MenuRenderer.cs
- RegistryKey.cs
- EventMemberCodeDomSerializer.cs
- PartialCachingAttribute.cs
- IISMapPath.cs
- DbResourceAllocator.cs
- AxisAngleRotation3D.cs
- MatchAllMessageFilter.cs
- DateTimeFormat.cs
- ConstraintManager.cs
- TraceSection.cs
- SecurityElement.cs
- SeparatorAutomationPeer.cs
- ValueHandle.cs
- SafeUserTokenHandle.cs
- DoubleKeyFrameCollection.cs
- AppDomainProtocolHandler.cs
- NumberSubstitution.cs
- JoinSymbol.cs
- MenuItemBindingCollection.cs
- PingOptions.cs
- DBConnection.cs
- TreeViewImageKeyConverter.cs
- ListenDesigner.cs
- VisualTreeHelper.cs
- UrlParameterReader.cs
- Padding.cs
- CellParagraph.cs
- BasicBrowserDialog.cs
- Instrumentation.cs
- InfocardExtendedInformationCollection.cs
- FontUnit.cs
- InstancePersistenceCommandException.cs
- UICuesEvent.cs
- JsonQNameDataContract.cs
- DesignOnlyAttribute.cs
- MetafileHeader.cs
- PathStreamGeometryContext.cs
- TransformerInfo.cs
- NamedPipeChannelListener.cs
- ResourceWriter.cs
- HostSecurityManager.cs
- SqlMethodAttribute.cs
- DrawingCollection.cs
- _ConnectionGroup.cs
- serverconfig.cs
- RegexCompiler.cs
- UriTemplateQueryValue.cs
- Util.cs
- TableLayoutSettingsTypeConverter.cs
- DataGridSortCommandEventArgs.cs
- Utilities.cs
- ExpandSegmentCollection.cs