Esempio n. 1
0
        public static void TraceCall(TcPlugin plugin, TraceLevel level, string callSignature, string result)
        {
#if TRACE
            string text = callSignature + (String.IsNullOrEmpty(result) ? null : ": " + result);
            if (plugin != null)
            {
                plugin.OnTcTrace(level, text);
                if (plugin.WriteTrace || level == TraceLevel.Error)
                {
                    TraceOut(level, text, plugin.TraceTitle);
                }
            }
            else
            {
                TraceOut(level, text, null);
            }
#endif
        }
Esempio n. 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);
            }
        }
 public PluginPassword(TcPlugin plugin, int cryptoNumber, int flags)
 {
     this.plugin       = plugin;
     this.cryptoNumber = cryptoNumber;
     this.flags        = (CryptFlags)flags;
 }