public void ITagDB_Test_Reopen()//关闭后重新打开 { GUTag p1 = db.NewTag("p1"); GUTag c1 = db.NewTag("c1"); db.SetParent(p1, c1); List <string> alias = db.QueryTagAlias(p1); foreach (string a in alias) { Logger.D(a); } Assert.AreEqual(1, alias.Count); Assert.AreEqual("p1", alias[0]); Logger.D("end test reopen"); IDisposableFactory.DisposeAll(); db = null; db = TagDBFactory.CreateTagDB("sql"); List <GUTag> p1new = db.QueryTags("p1"); alias = db.QueryTagAlias(p1new[0]); Assert.AreEqual(1, alias.Count); Assert.AreEqual("p1", alias[0]); }
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { IDisposableFactory.DisposeAll(); Logger.E(e.Exception); //e.Handled = true; //MessageBox.Show("发生内部异常,程序即将关闭,如需分析,请查看相关日志!"); }
public void teardown() { IDisposableFactory.DisposeAll(); File.Delete(CfgPath.IniFilePath); Directory.Delete(dir, true); Directory.Delete(docBase, true);//删除B目录下的文件,用于单元测试 }
public void teardown() { IDisposableFactory.DisposeAll(); db = null; //为了安全,直接硬编码,防止把真是数据删除 Directory.Delete(@"B:\00TagExplorerBase", true); //Directory.Delete(CfgPath.DocBasePath); //if (System.IO.Directory.Exists(Cfg.Ins.TagDB)) // System.IO.Directory.Delete(Cfg.Ins.TagDB,true); }
public void teardown() { IDisposableFactory.DisposeAll(); db = null; while (File.Exists(CfgPath.TagDBPath_SQLite)) { try { File.Delete(CfgPath.TagDBPath_SQLite); System.Threading.Thread.Sleep(100); break; } catch (Exception ee) { Logger.E(ee); System.Threading.Thread.Sleep(100); } } //为了安全,直接硬编码,防止把真是数据删除 string dir = @"B:\00TagExplorerBase"; while (Directory.Exists(dir)) { try { Directory.Delete(dir, true); System.Threading.Thread.Sleep(100); break; } catch (Exception ee) { Logger.E(ee); System.Threading.Thread.Sleep(100); } } //Directory.Delete(CfgPath.DocBasePath); //if (System.IO.Directory.Exists(Cfg.Ins.TagDB)) // System.IO.Directory.Delete(Cfg.Ins.TagDB,true); }
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { IDisposableFactory.DisposeAll(); Logger.E(e.ExceptionObject.ToString()); MessageBox.Show("发生内部异常,程序即将关闭,如需分析,请查看相关日志!"); }
private void App_Exit(object sender, ExitEventArgs e) { IDisposableFactory.DisposeAll(); Logger.E("App Exit:" + e.ApplicationExitCode); }