Beispiel #1
0
        public static void MainDomainTraceHandler()
        {
            string         category = (string)AppDomain.CurrentDomain.GetData(TraceCallbackPluginId);
            TraceEventArgs e        = (TraceEventArgs)AppDomain.CurrentDomain.GetData(TraceCallbackEventArg);

            TcTrace.TraceOut(e.Level, e.Text, category);
        }
Beispiel #2
0
        protected static void PluginDomainTraceHandler(object sender, TraceEventArgs e)
        {
            TcPlugin tp = sender as TcPlugin;

            if (tp == null)
            {
                return;
            }

            AppDomain mainDomain = tp.MainDomain;

            mainDomain.SetData(TraceCallbackPluginId, tp.TraceTitle);
            mainDomain.SetData(TraceCallbackEventArg, e);
            try {
                mainDomain.DoCallBack(MainDomainTraceHandler);
            } finally {
                mainDomain.SetData(TraceCallbackEventArg, null);
                mainDomain.SetData(TraceCallbackPluginId, null);
            }
        }