static void Main() { GpTraceSource.Listeners.Add(new ConsoleTraceListener(false)); GpTraceSource.Switch.Level = SourceLevels.All; SW.Reset(); SW.Start(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException); // Set the unhandled exception mode to force all Windows Forms errors to go through // our handler. System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); // Add the event handler for handling non-UI thread exceptions to the event. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN"); DevExpress.Skins.SkinManager.EnableFormSkins(); DevExpress.Skins.SkinManager.EnableMdiFormSkins(); SW.Stop(); GpTraceSource.TraceInformation("配置时间差:{0}毫秒", SW.ElapsedMilliseconds); Application.Run(new AppForm()); }
public void Run(ITestManager tm) { if (tm == null) { throw new ArgumentException("Test Manager is not initialized"); } SetTestManager(tm); SW.Reset(); if (ValidateTestInputs()) { PreTestSetup(); SW.Start(); ProcessTest(); SW.Stop(); PostTestCleanup(); } }
internal SkryptEngine Execute(SkryptParser.ProgramContext program, bool isImporting = false, LexicalEnvironment lexicalEnvironment = null) { if (SW == null) { SW = Stopwatch.StartNew(); } else { SW.Start(); } ProgramContext = program; if (MemoryLimit > 0) { ResetMemoryUsage(); } Visitor.CurrentEnvironment = lexicalEnvironment ?? GlobalEnvironment; Visitor.Visit(ProgramContext); foreach (var kv in InitializeOnParse) { if (!kv.Value.IsInitialized) { kv.Value.Initialize(); } } if (!_discardGlobal) { CreateGlobals(); } SW.Stop(); return(this); }