Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiEventSink_DeferedProcessing.cs / 1305376 / 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
- WindowsScrollBar.cs
- PointConverter.cs
- CodeCompileUnit.cs
- PenThreadPool.cs
- MediaPlayer.cs
- MonitorWrapper.cs
- COM2Enum.cs
- RealProxy.cs
- WmlPhoneCallAdapter.cs
- EnumMember.cs
- Schema.cs
- RepeatEnumerable.cs
- WebPartManager.cs
- TrackBar.cs
- Stack.cs
- RangeValidator.cs
- MetroSerializationManager.cs
- GlobalProxySelection.cs
- RegexWorker.cs
- ExternalException.cs
- Debug.cs
- HitTestDrawingContextWalker.cs
- ResourceReferenceExpressionConverter.cs
- ErrorInfoXmlDocument.cs
- KnownBoxes.cs
- LogicalExpressionEditor.cs
- ScriptHandlerFactory.cs
- DoubleUtil.cs
- WebPartRestoreVerb.cs
- XmlWhitespace.cs
- DiscoveryClient.cs
- MergablePropertyAttribute.cs
- NoneExcludedImageIndexConverter.cs
- precedingquery.cs
- FormatConvertedBitmap.cs
- DefaultPropertyAttribute.cs
- ClockController.cs
- MetabaseServerConfig.cs
- Vector3DAnimationUsingKeyFrames.cs
- TransformDescriptor.cs
- SpecularMaterial.cs
- TextEndOfLine.cs
- HwndTarget.cs
- TagElement.cs
- WebPartChrome.cs
- HtmlControl.cs
- StreamInfo.cs
- CharAnimationBase.cs
- BreakRecordTable.cs
- WebPartsSection.cs
- PointUtil.cs
- CompilerCollection.cs
- StdValidatorsAndConverters.cs
- XmlReaderSettings.cs
- PresentationAppDomainManager.cs
- SafeProcessHandle.cs
- BrowserCapabilitiesCompiler.cs
- OutputCacheSection.cs
- SoundPlayerAction.cs
- ListViewItemMouseHoverEvent.cs
- _Win32.cs
- WebBrowsableAttribute.cs
- InputEventArgs.cs
- RandomNumberGenerator.cs
- CodeGroup.cs
- ComplexObject.cs
- PathFigureCollection.cs
- SiteIdentityPermission.cs
- Expression.DebuggerProxy.cs
- UnsafeNativeMethods.cs
- MenuItemBinding.cs
- ManipulationStartedEventArgs.cs
- SoapSchemaExporter.cs
- WebSysDisplayNameAttribute.cs
- EmptyControlCollection.cs
- Substitution.cs
- InterleavedZipPartStream.cs
- AudioFormatConverter.cs
- CatchBlock.cs
- HtmlInputPassword.cs
- HtmlLink.cs
- EntryWrittenEventArgs.cs
- RuntimeConfig.cs
- TableLayoutPanelCellPosition.cs
- Environment.cs
- SafeRegistryKey.cs
- IPAddressCollection.cs
- ServerValidateEventArgs.cs
- FilePrompt.cs
- TreeViewImageKeyConverter.cs
- RequestCache.cs
- Console.cs
- CatalogZone.cs
- ByteArrayHelperWithString.cs
- XmlParserContext.cs
- ByteStream.cs
- JoinElimination.cs
- StaticResourceExtension.cs
- RankException.cs
- Soap12ProtocolImporter.cs