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
- ItemContainerProviderWrapper.cs
- OpenTypeCommon.cs
- MetafileHeaderWmf.cs
- processwaithandle.cs
- TargetConverter.cs
- TypographyProperties.cs
- StreamAsIStream.cs
- SchemeSettingElement.cs
- StreamUpgradeProvider.cs
- ISFTagAndGuidCache.cs
- PersonalizationStateInfo.cs
- String.cs
- ClientSettingsStore.cs
- InputScope.cs
- TextEditorLists.cs
- EastAsianLunisolarCalendar.cs
- AdministrationHelpers.cs
- HwndSourceKeyboardInputSite.cs
- TargetControlTypeAttribute.cs
- StructuralType.cs
- DebugInfoExpression.cs
- RetrieveVirtualItemEventArgs.cs
- SafeViewOfFileHandle.cs
- PageTheme.cs
- TakeOrSkipQueryOperator.cs
- PackagingUtilities.cs
- EntityDataSourceContainerNameConverter.cs
- SatelliteContractVersionAttribute.cs
- ProgressBar.cs
- CodeTypeReference.cs
- RtfToken.cs
- SiteOfOriginContainer.cs
- StreamUpdate.cs
- RelationshipEndCollection.cs
- NamespaceInfo.cs
- PageParserFilter.cs
- CroppedBitmap.cs
- VScrollProperties.cs
- CoreSwitches.cs
- LicenseProviderAttribute.cs
- ListControlConvertEventArgs.cs
- MenuEventArgs.cs
- CustomAttributeSerializer.cs
- GcSettings.cs
- DefaultHttpHandler.cs
- PropertyMapper.cs
- CornerRadius.cs
- OdbcFactory.cs
- CellQuery.cs
- EditingCommands.cs
- ApplicationCommands.cs
- ResourceType.cs
- entityreference_tresulttype.cs
- BaseAsyncResult.cs
- CodeMemberField.cs
- SchemaImporterExtensionsSection.cs
- ListControlBoundActionList.cs
- WindowsTitleBar.cs
- ConfigurationStrings.cs
- XmlSerializationReader.cs
- DirectoryObjectSecurity.cs
- ApplicationSecurityManager.cs
- PolygonHotSpot.cs
- HostAdapter.cs
- ToolStripPanel.cs
- StringToken.cs
- util.cs
- SctClaimDictionary.cs
- ValidationRuleCollection.cs
- MatrixAnimationUsingPath.cs
- MemoryStream.cs
- ExpressionHelper.cs
- URLMembershipCondition.cs
- CriticalFinalizerObject.cs
- DataGridTextBoxColumn.cs
- DPTypeDescriptorContext.cs
- KeyNotFoundException.cs
- DurationConverter.cs
- CodeTypeReference.cs
- ItemMap.cs
- StoreItemCollection.cs
- FormView.cs
- SpeechSeg.cs
- WebPartConnectionsCloseVerb.cs
- DesignerActionUIStateChangeEventArgs.cs
- XmlAttributeOverrides.cs
- SecurityCapabilities.cs
- SpecularMaterial.cs
- WebServiceHostFactory.cs
- XPathNodeInfoAtom.cs
- WsatServiceAddress.cs
- _KerberosClient.cs
- ArrayMergeHelper.cs
- ListViewInsertedEventArgs.cs
- GridViewSelectEventArgs.cs
- EvidenceBase.cs
- Geometry.cs
- Metafile.cs
- SqlDataSourceConnectionPanel.cs
- TextTreeTextNode.cs