Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MissingMemberException.cs
- Propagator.cs
- DataServiceQueryException.cs
- DPCustomTypeDescriptor.cs
- ISO2022Encoding.cs
- PersistenceTypeAttribute.cs
- QuarticEase.cs
- AgileSafeNativeMemoryHandle.cs
- AttachInfo.cs
- DetailsViewUpdateEventArgs.cs
- IPipelineRuntime.cs
- StrongNamePublicKeyBlob.cs
- InfoCardTrace.cs
- _SslSessionsCache.cs
- Mappings.cs
- SqlDataSourceView.cs
- RuleSetCollection.cs
- MessageBox.cs
- GeneratedView.cs
- LinqDataSourceEditData.cs
- DBSqlParserColumnCollection.cs
- ResXDataNode.cs
- DragEvent.cs
- InvalidEnumArgumentException.cs
- SettingsBase.cs
- ManagedIStream.cs
- RTLAwareMessageBox.cs
- SourceElementsCollection.cs
- SerializationAttributes.cs
- RequestQueryParser.cs
- TreeSet.cs
- TypedTableBaseExtensions.cs
- TraceInternal.cs
- DeploymentSection.cs
- RewritingPass.cs
- XmlSchemaCompilationSettings.cs
- ListBindingHelper.cs
- IdnMapping.cs
- FloaterParaClient.cs
- RepeatInfo.cs
- SqlInternalConnectionSmi.cs
- QueryHandler.cs
- DataColumnMapping.cs
- DataSourceSerializationException.cs
- DataRelation.cs
- Single.cs
- IFlowDocumentViewer.cs
- SpinLock.cs
- ThaiBuddhistCalendar.cs
- PriorityBinding.cs
- ClientEndpointLoader.cs
- SyndicationDeserializer.cs
- InfoCardSymmetricCrypto.cs
- AnimationStorage.cs
- DataGridViewColumnCollectionEditor.cs
- Rijndael.cs
- TcpAppDomainProtocolHandler.cs
- ServicePointManager.cs
- PropagationProtocolsTracing.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- ActiveXSerializer.cs
- DbProviderFactoriesConfigurationHandler.cs
- LockCookie.cs
- ViewGenerator.cs
- WebPartManager.cs
- CodeGenerationManager.cs
- GCHandleCookieTable.cs
- UIPropertyMetadata.cs
- IssuanceLicense.cs
- RawStylusInputReport.cs
- WorkflowElementDialogWindow.xaml.cs
- DocumentApplicationJournalEntry.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- XPathDocumentIterator.cs
- Image.cs
- CompletedAsyncResult.cs
- FormsIdentity.cs
- Token.cs
- DefaultValueConverter.cs
- CompositeDispatchFormatter.cs
- HostSecurityManager.cs
- BitmapVisualManager.cs
- CustomBindingCollectionElement.cs
- RichTextBoxAutomationPeer.cs
- ListControl.cs
- RelationshipType.cs
- Task.cs
- IDQuery.cs
- GB18030Encoding.cs
- EncoderFallback.cs
- StreamWriter.cs
- InputScopeNameConverter.cs
- XmlDataSource.cs
- FontDialog.cs
- GatewayDefinition.cs
- _DigestClient.cs
- SoapSchemaMember.cs
- SynchronizedKeyedCollection.cs
- ReadOnlyState.cs