Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Odbc / OdbcReferenceCollection.cs / 1 / OdbcReferenceCollection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; namespace System.Data.Odbc { sealed internal class OdbcReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Recover = 1; internal const int CommandTag = 1; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { switch (message) { case Recover: if (CommandTag == tag) { ((OdbcCommand) value).RecoverFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; case Closing: if (CommandTag == tag) { ((OdbcCommand) value).CloseFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; default: Debug.Assert(false, "shouldn't be here"); break; } 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. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Data.ProviderBase; using System.Diagnostics; namespace System.Data.Odbc { sealed internal class OdbcReferenceCollection : DbReferenceCollection { internal const int Closing = 0; internal const int Recover = 1; internal const int CommandTag = 1; override public void Add(object value, int tag) { base.AddItem(value, tag); } override protected bool NotifyItem(int message, int tag, object value) { switch (message) { case Recover: if (CommandTag == tag) { ((OdbcCommand) value).RecoverFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; case Closing: if (CommandTag == tag) { ((OdbcCommand) value).CloseFromConnection(); } else { Debug.Assert(false, "shouldn't be here"); } break; default: Debug.Assert(false, "shouldn't be here"); break; } 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
- CompletionProxy.cs
- AuthorizationRuleCollection.cs
- UserPreferenceChangingEventArgs.cs
- CryptoHelper.cs
- BinaryNode.cs
- Rect3DConverter.cs
- NetworkInformationException.cs
- WebServiceHostFactory.cs
- ExceptionUtil.cs
- UrlMappingsModule.cs
- RuntimeWrappedException.cs
- ValidatingPropertiesEventArgs.cs
- TypeInitializationException.cs
- SettingsPropertyValue.cs
- Model3D.cs
- RTLAwareMessageBox.cs
- CorrelationManager.cs
- FixedSOMTableRow.cs
- SourceFileInfo.cs
- AnnotationResourceChangedEventArgs.cs
- Visual3D.cs
- Compress.cs
- LayoutEvent.cs
- PointLightBase.cs
- ApplicationActivator.cs
- Label.cs
- EncodingDataItem.cs
- TypeSystem.cs
- StateDesigner.Layouts.cs
- HandlerWithFactory.cs
- SymmetricKey.cs
- InstanceLockException.cs
- Int32Converter.cs
- InputReport.cs
- Tag.cs
- QilBinary.cs
- ListViewDeletedEventArgs.cs
- TextTreeRootNode.cs
- EnumMember.cs
- EventRecord.cs
- RawContentTypeMapper.cs
- ArraySortHelper.cs
- ProtocolProfile.cs
- ParameterToken.cs
- BinaryObjectWriter.cs
- XpsImageSerializationService.cs
- Int16.cs
- FileDialogCustomPlace.cs
- _RegBlobWebProxyDataBuilder.cs
- WpfKnownMemberInvoker.cs
- XmlnsCompatibleWithAttribute.cs
- OletxTransactionManager.cs
- MetaType.cs
- Form.cs
- Currency.cs
- AccessDataSource.cs
- PackageRelationship.cs
- TransformedBitmap.cs
- ViewGenResults.cs
- Point.cs
- MdiWindowListItemConverter.cs
- SendKeys.cs
- login.cs
- ObjectDataSourceSelectingEventArgs.cs
- LayoutTableCell.cs
- BaseProcessor.cs
- Util.cs
- RowUpdatingEventArgs.cs
- XamlToRtfWriter.cs
- MultipleViewPatternIdentifiers.cs
- SerializationUtility.cs
- DynamicActivityXamlReader.cs
- FileReservationCollection.cs
- HebrewCalendar.cs
- TextParaLineResult.cs
- HttpChannelHelper.cs
- WebPartMenuStyle.cs
- SafeArchiveContext.cs
- SiteMapProvider.cs
- SplitterCancelEvent.cs
- PropertyConverter.cs
- WebRequestModuleElement.cs
- PackWebRequestFactory.cs
- URL.cs
- Currency.cs
- ComplexBindingPropertiesAttribute.cs
- HtmlInputHidden.cs
- CachedFontFace.cs
- XmlQuerySequence.cs
- ResourceWriter.cs
- DynamicAttribute.cs
- Label.cs
- GetReadStreamResult.cs
- MailSettingsSection.cs
- DesignerListAdapter.cs
- RemotingSurrogateSelector.cs
- SqlClientFactory.cs
- LineBreakRecord.cs
- PropertyTab.cs
- GeometryDrawing.cs