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
- XXXInfos.cs
- FacetValueContainer.cs
- SingleAnimation.cs
- Faults.cs
- DriveInfo.cs
- RegionData.cs
- CreateUserWizard.cs
- TextServicesDisplayAttribute.cs
- StrokeNodeData.cs
- IssuedTokenClientBehaviorsElement.cs
- GZipDecoder.cs
- AlphabetConverter.cs
- PathGradientBrush.cs
- XmlnsDictionary.cs
- HorizontalAlignConverter.cs
- ObjectDisposedException.cs
- ContainerParagraph.cs
- RestHandler.cs
- FormsAuthenticationEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- MaterialGroup.cs
- DataGridViewCellLinkedList.cs
- WebPartEditorApplyVerb.cs
- NoClickablePointException.cs
- CodeDefaultValueExpression.cs
- RemoteCryptoSignHashRequest.cs
- ReadOnlyDataSource.cs
- DateTimeConverter2.cs
- COM2Enum.cs
- BreakRecordTable.cs
- QilName.cs
- FilterableData.cs
- COM2Properties.cs
- AuthorizationContext.cs
- XamlFilter.cs
- AbstractSvcMapFileLoader.cs
- BaseDataList.cs
- HitTestParameters3D.cs
- sqlinternaltransaction.cs
- SystemPens.cs
- BufferedReadStream.cs
- SByteStorage.cs
- WebContext.cs
- RequestResizeEvent.cs
- DashStyle.cs
- EntityProviderServices.cs
- ImageCodecInfoPrivate.cs
- OptionalMessageQuery.cs
- PropertyInformation.cs
- ToolstripProfessionalRenderer.cs
- DataBoundControl.cs
- WebPartsPersonalizationAuthorization.cs
- SqlUdtInfo.cs
- AsynchronousChannelMergeEnumerator.cs
- PartialToken.cs
- StorageMappingItemLoader.cs
- DesignerSerializationVisibilityAttribute.cs
- Soap.cs
- OleDbConnection.cs
- TextDecorationLocationValidation.cs
- CheckPair.cs
- UInt16Storage.cs
- ResumeStoryboard.cs
- MimeTypePropertyAttribute.cs
- Deserializer.cs
- RawStylusSystemGestureInputReport.cs
- CreateUserWizardAutoFormat.cs
- PolyLineSegment.cs
- Operators.cs
- HandledEventArgs.cs
- SystemFonts.cs
- Parameter.cs
- GenericEnumerator.cs
- ScrollItemProviderWrapper.cs
- TextDecorationUnitValidation.cs
- XMLDiffLoader.cs
- FormsAuthenticationEventArgs.cs
- CodeBinaryOperatorExpression.cs
- CollectionTypeElement.cs
- AdornerDecorator.cs
- ReliabilityContractAttribute.cs
- Item.cs
- IsolationInterop.cs
- NameValueSectionHandler.cs
- ReachDocumentSequenceSerializerAsync.cs
- XmlKeywords.cs
- UpdateDelegates.Generated.cs
- SqlBuilder.cs
- IriParsingElement.cs
- CodeSnippetCompileUnit.cs
- Query.cs
- XAMLParseException.cs
- ReadWriteObjectLock.cs
- TimelineGroup.cs
- XmlDataSource.cs
- WebResourceAttribute.cs
- SqlCachedBuffer.cs
- XmlWrappingReader.cs
- ScriptDescriptor.cs
- AgileSafeNativeMemoryHandle.cs