Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiEventSink_DeferedProcessing.cs / 1 / SmiEventSink_DeferedProcessing.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System.Data.Sql; using System.Data.SqlClient; using System.Diagnostics; // This class exists purely to defer processing of messages until a later time. // It is designed to allow calling common code that interacts with the SMI layers // without throwing or otherwise processing messages in the sink until later on. // // Main example: // SqlCommand.ExecuteNonQuerySmi calls EventStream.ProcessEvent with it's command event sink (CES) // ProcessEvent calls OnParametersAvailable on the CES // OnParametersAvailable sets up a deferedprocessing event sink (DPES) with the CES as its parent // OnParametersAvailable calls ValueUtils to extract param values passing the DPES // ValueUtils calls Smi passing DPES // Smi may call MessagePosted, which will send a message up the sink parent chain and save it. // ValueUtils calls ProcessMessagesAndThrow on DPES, which skips handling // ... return up the stack ... // SqlCommand.ExecuteNonQuerySmi calls CES.ProcessMessagesAndThrow, which handles the messages // sent from the Smi value extraction code. // // IMPORTANT: Code that uses the DeferedProccess event sink is responsible for ensuring that // these messages ARE processed at some point. internal class SmiEventSink_DeferedProcessing : SmiEventSink_Default { internal SmiEventSink_DeferedProcessing ( SmiEventSink parent ) : base(parent) { } protected override void DispatchMessages(bool ignoreNonFatalMessages) { // Skip processing messages. Since messages are sent to parent and calling code will call // ProcessMessages against parent, messages ARE NOT LOST! } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System.Data.Sql; using System.Data.SqlClient; using System.Diagnostics; // This class exists purely to defer processing of messages until a later time. // It is designed to allow calling common code that interacts with the SMI layers // without throwing or otherwise processing messages in the sink until later on. // // Main example: // SqlCommand.ExecuteNonQuerySmi calls EventStream.ProcessEvent with it's command event sink (CES) // ProcessEvent calls OnParametersAvailable on the CES // OnParametersAvailable sets up a deferedprocessing event sink (DPES) with the CES as its parent // OnParametersAvailable calls ValueUtils to extract param values passing the DPES // ValueUtils calls Smi passing DPES // Smi may call MessagePosted, which will send a message up the sink parent chain and save it. // ValueUtils calls ProcessMessagesAndThrow on DPES, which skips handling // ... return up the stack ... // SqlCommand.ExecuteNonQuerySmi calls CES.ProcessMessagesAndThrow, which handles the messages // sent from the Smi value extraction code. // // IMPORTANT: Code that uses the DeferedProccess event sink is responsible for ensuring that // these messages ARE processed at some point. internal class SmiEventSink_DeferedProcessing : SmiEventSink_Default { internal SmiEventSink_DeferedProcessing ( SmiEventSink parent ) : base(parent) { } protected override void DispatchMessages(bool ignoreNonFatalMessages) { // Skip processing messages. Since messages are sent to parent and calling code will call // ProcessMessages against parent, messages ARE NOT LOST! } } } // 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
- DecoderBestFitFallback.cs
- PeerNameResolver.cs
- XmlElementAttributes.cs
- DnsPermission.cs
- BitmapEffectState.cs
- TemplatePropertyEntry.cs
- URLMembershipCondition.cs
- MenuItemStyle.cs
- AudioFileOut.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ConnectionPoolManager.cs
- adornercollection.cs
- CompositeScriptReference.cs
- WebPartConnectionsConnectVerb.cs
- XhtmlBasicValidatorAdapter.cs
- ValidationRuleCollection.cs
- CodeRegionDirective.cs
- Math.cs
- Lease.cs
- DependencyPropertyChangedEventArgs.cs
- CommandDevice.cs
- BindingCollection.cs
- MouseOverProperty.cs
- ValidationEventArgs.cs
- ObjectParameter.cs
- XDRSchema.cs
- DesignBindingEditor.cs
- AmbientLight.cs
- CurrentChangedEventManager.cs
- AttributedMetaModel.cs
- DataGridViewEditingControlShowingEventArgs.cs
- Metadata.cs
- SoapWriter.cs
- SessionEndingCancelEventArgs.cs
- RegexCompiler.cs
- Debug.cs
- CommandValueSerializer.cs
- UpWmlMobileTextWriter.cs
- FrameworkTemplate.cs
- DataGridColumnHeadersPresenter.cs
- Resources.Designer.cs
- Parameter.cs
- ReturnType.cs
- BaseCodePageEncoding.cs
- Int32.cs
- RowParagraph.cs
- DoubleSumAggregationOperator.cs
- HttpModuleAction.cs
- DesignerMetadata.cs
- PenCursorManager.cs
- CodeCompileUnit.cs
- ProfileEventArgs.cs
- ComplexPropertyEntry.cs
- CheckedListBox.cs
- HttpResponseInternalWrapper.cs
- SecurityTokenParameters.cs
- ChameleonKey.cs
- DrawingState.cs
- PolyLineSegmentFigureLogic.cs
- NTAccount.cs
- MsmqActivation.cs
- BitStack.cs
- ConsoleTraceListener.cs
- SystemException.cs
- CodeTypeMemberCollection.cs
- TableAdapterManagerGenerator.cs
- CatchDesigner.xaml.cs
- NameValuePair.cs
- ExpressionWriter.cs
- MenuItem.cs
- httpserverutility.cs
- DeviceFiltersSection.cs
- CachedFontFamily.cs
- PlatformNotSupportedException.cs
- EdmValidator.cs
- XmlDeclaration.cs
- ErrorHandler.cs
- SqlMethodCallConverter.cs
- ProxySimple.cs
- SkinBuilder.cs
- HttpApplicationFactory.cs
- SchemaElementDecl.cs
- EncoderNLS.cs
- hresults.cs
- TypeListConverter.cs
- EventDriven.cs
- PagePropertiesChangingEventArgs.cs
- invalidudtexception.cs
- IsolatedStorage.cs
- AQNBuilder.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- MulticastNotSupportedException.cs
- DelayedRegex.cs
- diagnosticsswitches.cs
- ProxyWebPartConnectionCollection.cs
- Library.cs
- CaseInsensitiveHashCodeProvider.cs
- Registry.cs
- ApplicationFileCodeDomTreeGenerator.cs
- LeftCellWrapper.cs