Ejemplo n.º 1
0
 internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent)
 {
     if (profilerEvent != RemotingProfilerEvent.ClientSend)
     {
         if (profilerEvent != RemotingProfilerEvent.ClientReceive || !RemotingServices.CORProfilerTrackRemoting())
         {
             return;
         }
         Guid id = Guid.Empty;
         if (RemotingServices.CORProfilerTrackRemotingCookie())
         {
             object obj = msg.Properties[(object)"CORProfilerCookie"];
             if (obj != null)
             {
                 id = (Guid)obj;
             }
         }
         RemotingServices.CORProfilerRemotingClientReceivingReply(id, false);
     }
     else
     {
         if (!RemotingServices.CORProfilerTrackRemoting())
         {
             return;
         }
         Guid id;
         RemotingServices.CORProfilerRemotingClientSendingMessage(out id, false);
         if (!RemotingServices.CORProfilerTrackRemotingCookie())
         {
             return;
         }
         msg.Properties[(object)"CORProfilerCookie"] = (object)id;
     }
 }
Ejemplo n.º 2
0
        //
        // INTERNAL PROFILER NOTIFICATION SERVICES
        //

        internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent)
        {
            switch (profilerEvent)
            {
            case RemotingProfilerEvent.ClientSend:
            {
                if (RemotingServices.CORProfilerTrackRemoting())
                {
                    Guid g;

                    RemotingServices.CORProfilerRemotingClientSendingMessage(out g, false);

                    if (RemotingServices.CORProfilerTrackRemotingCookie())
                    {
                        msg.Properties["CORProfilerCookie"] = g;
                    }
                }
                break;
            } // case RemotingProfilerEvent.ClientSend

            case RemotingProfilerEvent.ClientReceive:
            {
                if (RemotingServices.CORProfilerTrackRemoting())
                {
                    Guid g = Guid.Empty;

                    if (RemotingServices.CORProfilerTrackRemotingCookie())
                    {
                        Object obj = msg.Properties["CORProfilerCookie"];

                        if (obj != null)
                        {
                            g = (Guid)obj;
                        }
                    }

                    RemotingServices.CORProfilerRemotingClientReceivingReply(g, false);
                }
                break;
            } // case RemotingProfilerEvent.ClientReceive
            } // switch (event)
        }     // NotifyProfiler
        internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent)
        {
            switch (profilerEvent)
            {
            case RemotingProfilerEvent.ClientSend:
                Guid guid;
                if (!RemotingServices.CORProfilerTrackRemoting())
                {
                    break;
                }
                RemotingServices.CORProfilerRemotingClientSendingMessage(out guid, false);
                if (!RemotingServices.CORProfilerTrackRemotingCookie())
                {
                    break;
                }
                msg.Properties["CORProfilerCookie"] = guid;
                return;

            case RemotingProfilerEvent.ClientReceive:
                if (RemotingServices.CORProfilerTrackRemoting())
                {
                    Guid empty = Guid.Empty;
                    if (RemotingServices.CORProfilerTrackRemotingCookie())
                    {
                        object obj2 = msg.Properties["CORProfilerCookie"];
                        if (obj2 != null)
                        {
                            empty = (Guid)obj2;
                        }
                    }
                    RemotingServices.CORProfilerRemotingClientReceivingReply(empty, false);
                }
                break;

            default:
                return;
            }
        }
        [System.Security.SecurityCritical]  // auto-generated 
        internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent)
        { 
            switch (profilerEvent)
            {

            case RemotingProfilerEvent.ClientSend: 
            {
                if (RemotingServices.CORProfilerTrackRemoting()) 
                { 
                    Guid g;
 
                    RemotingServices.CORProfilerRemotingClientSendingMessage(out g, false);

                    if (RemotingServices.CORProfilerTrackRemotingCookie())
                        msg.Properties["CORProfilerCookie"] = g; 
                }
                break; 
            } // case RemotingProfilerEvent.ClientSend 

            case RemotingProfilerEvent.ClientReceive: 
            {
                if (RemotingServices.CORProfilerTrackRemoting())
                {
                    Guid g = Guid.Empty; 

                    if (RemotingServices.CORProfilerTrackRemotingCookie()) 
                    { 
                        Object obj = msg.Properties["CORProfilerCookie"];
 
                        if (obj != null)
                        {
                            g = (Guid) obj;
                        } 
                    }
 
                    RemotingServices.CORProfilerRemotingClientReceivingReply(g, false); 
                }
                break; 
            } // case RemotingProfilerEvent.ClientReceive

            } // switch (event)
        } // NotifyProfiler 
        internal static void NotifyProfiler(IMessage msg, RemotingProfilerEvent profilerEvent)
        {
            switch (profilerEvent)
            {
                case RemotingProfilerEvent.ClientSend:
                    Guid guid;
                    if (!RemotingServices.CORProfilerTrackRemoting())
                    {
                        break;
                    }
                    RemotingServices.CORProfilerRemotingClientSendingMessage(out guid, false);
                    if (!RemotingServices.CORProfilerTrackRemotingCookie())
                    {
                        break;
                    }
                    msg.Properties["CORProfilerCookie"] = guid;
                    return;

                case RemotingProfilerEvent.ClientReceive:
                    if (RemotingServices.CORProfilerTrackRemoting())
                    {
                        Guid empty = Guid.Empty;
                        if (RemotingServices.CORProfilerTrackRemotingCookie())
                        {
                            object obj2 = msg.Properties["CORProfilerCookie"];
                            if (obj2 != null)
                            {
                                empty = (Guid) obj2;
                            }
                        }
                        RemotingServices.CORProfilerRemotingClientReceivingReply(empty, false);
                    }
                    break;

                default:
                    return;
            }
        }