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
- LineBreak.cs
- Compiler.cs
- CancellationScope.cs
- MasterPageBuildProvider.cs
- followingquery.cs
- Configuration.cs
- HeaderUtility.cs
- IPEndPoint.cs
- NativeMethods.cs
- ProfileWorkflowElement.cs
- PagerSettings.cs
- HintTextConverter.cs
- PersonalizationProviderHelper.cs
- DataGridItemCollection.cs
- SelectionPatternIdentifiers.cs
- TypeConverterHelper.cs
- DataGridTextColumn.cs
- WorkflowServiceHostFactory.cs
- SmiRequestExecutor.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- PlainXmlDeserializer.cs
- SqlTrackingWorkflowInstance.cs
- FileDialog_Vista.cs
- XmlDocumentFragment.cs
- WindowsToolbarItemAsMenuItem.cs
- PrintPreviewControl.cs
- HiddenField.cs
- OdbcReferenceCollection.cs
- FixedPageProcessor.cs
- DeviceSpecificDesigner.cs
- SimpleType.cs
- TextFormatterImp.cs
- CodeIndexerExpression.cs
- ObfuscationAttribute.cs
- XmlTextAttribute.cs
- RoutedPropertyChangedEventArgs.cs
- TraceHandler.cs
- Size.cs
- FileDetails.cs
- DrawingCollection.cs
- WebPartDisplayModeEventArgs.cs
- InvalidFilterCriteriaException.cs
- ResXFileRef.cs
- CompiledAction.cs
- AnnotationMap.cs
- MaskDesignerDialog.cs
- DefaultAsyncDataDispatcher.cs
- ServiceContractListItem.cs
- ProviderCommandInfoUtils.cs
- SchemaInfo.cs
- WmiPutTraceRecord.cs
- FileClassifier.cs
- BulletedListEventArgs.cs
- AssociationSet.cs
- NativeRightsManagementAPIsStructures.cs
- UserValidatedEventArgs.cs
- ContractMapping.cs
- DiffuseMaterial.cs
- SessionStateModule.cs
- ButtonBase.cs
- TeredoHelper.cs
- XmlSchemaSimpleContentExtension.cs
- OdbcInfoMessageEvent.cs
- DataSourceCollectionBase.cs
- ListSortDescription.cs
- RefreshPropertiesAttribute.cs
- DbReferenceCollection.cs
- PassportPrincipal.cs
- DependencySource.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- CompilationUnit.cs
- TypeToken.cs
- Matrix.cs
- DataTablePropertyDescriptor.cs
- InkCanvasSelectionAdorner.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DelegateBodyWriter.cs
- FilterableAttribute.cs
- Site.cs
- KerberosTicketHashIdentifierClause.cs
- SignedXml.cs
- Reference.cs
- CachedFontFamily.cs
- ImageResources.Designer.cs
- MergeFailedEvent.cs
- XmlDictionary.cs
- ServerIdentity.cs
- ToolbarAUtomationPeer.cs
- HiddenFieldPageStatePersister.cs
- ConfigXmlWhitespace.cs
- BindingBase.cs
- DataControlFieldCollection.cs
- Bold.cs
- FixUp.cs
- CodeAccessSecurityEngine.cs
- MinMaxParagraphWidth.cs
- XsltQilFactory.cs
- ResourceAttributes.cs
- StringSorter.cs
- Set.cs