Esempio n. 1
0
        private void MacroMain()
        {
            try {
                InitEnv();

                _entryPoint.Invoke(null, new object[1] {
                    new string[0]
                });
            }
            catch (TargetInvocationException tex) {
                Exception inner = tex.InnerException;
                if (_traceWindow == null)
                {
                    GApp.InterThreadUIService.Warning(String.Format(GApp.Strings.GetString("Message.MacroExec.ExceptionWithoutTraceWindow"), inner.Message));
                    Debug.WriteLine("TargetInvocationException");
                    Debug.WriteLine(inner.GetType().Name);
                    Debug.WriteLine(inner.Message);
                    Debug.WriteLine(inner.StackTrace);
                }
                else
                {
                    _traceWindow.AddLine(GApp.Strings.GetString("Message.MacroExec.ExceptionInMacro"));
                    _traceWindow.AddLine(String.Format("{0} : {1}", inner.GetType().FullName, inner.Message));
                    _traceWindow.AddLine(inner.StackTrace);
                }
            }
            catch (Exception ex) {
                Debug.WriteLine(ex.Message);
                Debug.WriteLine(ex.StackTrace);
            }
            finally {
                GApp.InterThreadUIService.MacroFinished();
            }
        }
Esempio n. 2
0
        public override void Trace(string msg)
        {
            if (_debugWindow == null || _debugWindow.IsDisposed)
            {
                return;
            }

            _debugWindow.AddLine(msg);
        }