当前位置: 首页>>代码示例>>C#>>正文


C# Context.NotifyDynamicSinks方法代码示例

本文整理汇总了C#中System.Runtime.Remoting.Contexts.Context.NotifyDynamicSinks方法的典型用法代码示例。如果您正苦于以下问题:C# Context.NotifyDynamicSinks方法的具体用法?C# Context.NotifyDynamicSinks怎么用?C# Context.NotifyDynamicSinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Runtime.Remoting.Contexts.Context的用法示例。


在下文中一共展示了Context.NotifyDynamicSinks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CallProcessMessage

 internal static IMessage CallProcessMessage(IMessageSink ms, IMessage reqMsg, ArrayWithSize proxySinks, Thread currentThread, Context currentContext, bool bSkippingContextChain)
 {
     if (proxySinks != null)
     {
         DynamicPropertyHolder.NotifyDynamicSinks(reqMsg, proxySinks, true, true, false);
     }
     bool flag = false;
     if (bSkippingContextChain)
     {
         flag = currentContext.NotifyDynamicSinks(reqMsg, true, true, false, true);
         ChannelServices.NotifyProfiler(reqMsg, RemotingProfilerEvent.ClientSend);
     }
     if (ms == null)
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Proxy_NoChannelSink"));
     }
     IMessage msg = ms.SyncProcessMessage(reqMsg);
     if (bSkippingContextChain)
     {
         ChannelServices.NotifyProfiler(msg, RemotingProfilerEvent.ClientReceive);
         if (flag)
         {
             currentContext.NotifyDynamicSinks(msg, true, false, false, true);
         }
     }
     IMethodReturnMessage message2 = msg as IMethodReturnMessage;
     if ((msg == null) || (message2 == null))
     {
         throw new RemotingException(Environment.GetResourceString("Remoting_Message_BadType"));
     }
     if (proxySinks != null)
     {
         DynamicPropertyHolder.NotifyDynamicSinks(msg, proxySinks, true, false, false);
     }
     return msg;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:RemotingProxy.cs

示例2: CallProcessMessage

        // This is used when a TP is called with SyncProcessMessage
        internal static IMessage CallProcessMessage(IMessageSink ms, 
                                                    IMessage reqMsg, 
                                                    ArrayWithSize proxySinks,
                                                    Thread currentThread,
                                                    Context currentContext,
                                                    bool bSkippingContextChain)
        {                   
            // Notify Dynamic Sinks: CALL starting          
            if (proxySinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(
                                            reqMsg, 
                                            proxySinks, 
                                            true,   // bCliSide
                                            true,   // bStart
                                            false); // bAsync
            }

            RemotingServices.LogRemotingStage(RemotingServices.CLIENT_MSG_SINK_CHAIN);            

            bool bHasDynamicSinks = false;
            if (bSkippingContextChain)
            {
                // this would have been done in the client context terminator sink
                bHasDynamicSinks = 
                    currentContext.NotifyDynamicSinks(reqMsg, 
                        true,   // bCliSide
                        true,   // bStart
                        false,  // bAsync
                        true);  // bNotifyGlobals 
   
                ChannelServices.NotifyProfiler(reqMsg, RemotingProfilerEvent.ClientSend);
            }
            
            if (ms == null)
            {
                throw new RemotingException(
                    Environment.GetResourceString(
                        "Remoting_Proxy_NoChannelSink"));                    
            }

            IMessage retMsg = ms.SyncProcessMessage(reqMsg);

            if (bSkippingContextChain)
            {
                // this would have been done in the client context terminator sink
                ChannelServices.NotifyProfiler(retMsg, RemotingProfilerEvent.ClientReceive);

                if (bHasDynamicSinks)
                {
                    currentContext.NotifyDynamicSinks(
                        retMsg, 
                        true,   // bCliSide
                        false,   // bStart
                        false,  // bAsync
                        true);  // bNotifyGlobals  
                }
            }            

            IMethodReturnMessage mrm = retMsg as IMethodReturnMessage;
            if (retMsg == null || mrm == null)
            {
                throw new RemotingException(
                    Environment.GetResourceString("Remoting_Message_BadType"));                    
            }

            // notify DynamicSinks: CALL returned
            if (proxySinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(
                                            retMsg, 
                                            proxySinks, 
                                            true,   // bCliSide
                                            false,  // bStart
                                            false); // bAsync
            }

           
            RemotingServices.LogRemotingStage(RemotingServices.CLIENT_RET_PROPAGATION);

            return retMsg;
        }
开发者ID:ArildF,项目名称:masters,代码行数:83,代码来源:remotingproxy.cs


注:本文中的System.Runtime.Remoting.Contexts.Context.NotifyDynamicSinks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。