Ejemplo n.º 1
0
        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]);
        }
Ejemplo n.º 2
0
 public void setup()
 {
     //if (!System.IO.Directory.Exists(Cfg.Ins.TagDB))
     //{
     //    System.IO.Directory.CreateDirectory(Cfg.Ins.TagDB);
     //}
     db = TagDBFactory.CreateTagDB();
 }
Ejemplo n.º 3
0
 public void setup()
 {
     UTestCfg.Ins.IsUTest = true;
     //if (!System.IO.Directory.Exists(Cfg.Ins.TagDB))
     //{
     //    System.IO.Directory.CreateDirectory(Cfg.Ins.TagDB);
     //}
     db = TagDBFactory.CreateTagDB("sql");
 }
Ejemplo n.º 4
0
        public void test()
        {
            ITagDB tagdb = TagDBFactory.CreateTagDB();

            tagdb.AddTag("parent", "child");

            ITagLayout lay = TagLayoutFactory.CreateLayout();

            lay.Layout(tagdb, "parent");

            Assert.AreEqual(2, lay.Lines.Count());
            Assert.AreEqual(2, lay.TagArea.Count());
        }
Ejemplo n.º 5
0
        private void InitialViews()
        {
            if (uriDB == null || tagDB == null)
            {
                TipsCenter.Ins.StartTime = "Before Init DBS ";
                //URI DB初始化
                Logger.I("InitializeComponent Finished!,init uridb");
                uriDB = UriDBFactory.CreateUriDB();
                uriDB.UriDBChanged      += UriDBChangedCallback;
                TipsCenter.Ins.StartTime = "UriDB Init";

                //TAG DB初始化
                Logger.I("InitializeComponent Finished!,init tagdb");
                tagDB = TagDBFactory.CreateTagDB();
                tagDB.TagDBChanged      += TagDBChanged;
                TipsCenter.Ins.StartTime = "TagDB Init";

                //查询输入框初始化
                SearchBox.textBox.TextChanged += SearchBoxTextChanged_Callback;
                SearchBox.SearchDataProvider   = tagDB;
                TipsCenter.Ins.StartTime       = "SearchBoxInit";

                //Tag视图初始化
                tagCanvas.InitDB(tagDB, uriDB);
                tagCanvas.SelectedTagChanged += SelectedTagChanged_Callback;
                TipsCenter.Ins.StartTime      = "tagCanvasInit";

                GUTag mroot = GUTag.Parse(DynamicCfg.Ins.MainCanvasRoot, tagDB);
                TipsCenter.Ins.StartTime = "mRoot";
                GUTag sroot = GUTag.Parse(DynamicCfg.Ins.SubCanvasRoot, tagDB);
                TipsCenter.Ins.StartTime = "sRoot";
                TipsCenter.Ins.StartTime = "MainWindow:64(before showtaggraph)";
                ShowTagGraph(mroot, sroot);
                TipsCenter.Ins.StartTime = "AfterShowTagGraph";
                IDisposableFactory.New <MainWindow>(this);

                richTxt.Focus();
                this.Title = "TagExplorer " + CfgPath.RootPath;
                TipsCenter.Ins.StartTime = "MainWindow:70";
            }
        }