Inheritance: GenericContent, IFolder
Ejemplo n.º 1
0
 public static RefTestNode CreateRefTestNode(string name, Node parent)
 {
     RefTestNode rtn = null;
     string path = RepositoryPath.Combine(parent.Path, name);
     rtn = Node.LoadNode(path) as RefTestNode;
     if (rtn == null)
     {
         rtn = new RefTestNode(parent);
         rtn.Name = name;
         rtn.Save();
         AddPathToDelete(path);
     }
     return rtn;
 }
Ejemplo n.º 2
0
        public void CreateTestStructure()
        {
            //-- 1. level ----------------------------------------------------------------
            _f_1_1 = CreateFolder("NodeQueryTestFolder_1_1");
            _f_1_2 = CreateFolder("NodeQueryTestFolder_1_2");
            _f_1_3 = CreateFolder("NodeQueryTestFolder_1_3");
            _f_1_4 = CreateFolder("NodeQueryTestFolder_1_4");

            //-- 2. level ----------------------------------------------------------------
            _f_1_1_1 = CreateFolder("NodeQueryTestFolder_1_1_1", _f_1_1);
            _f_1_1_2 = CreateFolder("NodeQueryTestFolder_1_1_2", _f_1_1);

            _f_1_2_1 = CreateFolder("NodeQueryTestFolder_1_2_1", _f_1_2);
            _f_1_2_2 = CreateFolder("NodeQueryTestFolder_1_2_2", _f_1_2);

            //-- RefTestNode -------------------------------------------------------------

            //Grandfather: Carl
            //Grandmother: Helen
            //Father, housband: Adam
            //Mother, wife: Eva
            //Son, brother: Peter
            //Daughter, sister: Julia

            _carl = CreateRefTestNode("Carl");
            _helen = CreateRefTestNode("Helen");
            _adam = CreateRefTestNode("Adam");
            _eva = CreateRefTestNode("Eva");
            _peter = CreateRefTestNode("Peter");
            _julia = CreateRefTestNode("Julia");
            _jack = CreateRefTestNode("Jack");

            _carl.Wife = _helen;
            //_carl.Daughter = ;
            //_carl.Son = ;
            _carl.NickName = "ca";
            _carl.Age = 65;
            _carl.Save();

            _helen.Husband = _carl;
            _helen.Daughter = _eva;
            //_helen.Son = ;
            _helen.NickName = "he";
            _helen.Age = 64;
            _helen.Save();

            _adam.Wife = _eva;
            _adam.Daughter = _julia;
            _adam.Son = _peter;
            _adam.NickName = "ad";
            _adam.Age = 44;
            _adam.Save();

            _eva.Husband = _adam;
            _eva.Daughter = _julia;
            _eva.Son = _peter;
            _eva.NickName = "ev";
            _eva.Age = 42;
            _eva.Mother = _helen;
            _eva.Save();

            _peter.Mother = _eva;
            _peter.Father = _adam;
            _peter.NickName = "pe";
            _peter.Age = 12;
            _peter.Sister = _julia;
            _peter.Save();

            _julia.Husband = _jack;
            _julia.Mother = _eva;
            _julia.Father = _adam;
            _julia.NickName = "ju";
            _julia.Age = 23;
            _julia.Brother = _peter;
            _julia.Save();

            _jack.Wife = _julia;
            _jack.NickName = "ja";
            _jack.Age = 25;
            _jack.Save();

            //Father, housband: Joe
            //Mother, wife: Suzan
            //Son, brother: Tom
            //Daughter, sister: Liza

            _joe = CreateRefTestNode("Joe");
            _suzan = CreateRefTestNode("Suzan");
            _tom = CreateRefTestNode("Tom");
            _liza = CreateRefTestNode("Liza");

            _joe.Wife = _suzan;
            _joe.Daughter = _liza;
            _joe.Son = _tom;
            _joe.NickName = "jo";
            _joe.Age = 50;
            _joe.Save();

            _suzan.Husband = _joe;
            _suzan.Daughter = _liza;
            _suzan.Son = _tom;
            _suzan.NickName = "su";
            _suzan.Age = 45;
            _suzan.Save();

            _tom.Mother = _suzan;
            _tom.Father = _joe;
            _tom.NickName = "to";
            _tom.Age = 12;
            _tom.Sister = _liza;
            _tom.Save();

            _liza.Mother = _suzan;
            _liza.Father = _joe;
            _liza.NickName = "li";
            _liza.Age = 19;
            _liza.Brother = _tom;
            _liza.Save();
        }
Ejemplo n.º 3
0
        //-- Create nodes --------------------------------------------------------------------

        public static RefTestNode CreateRefTestNode(string name)
        {
            RefTestNode rtn = null;
            rtn = Node.LoadNode(string.Concat(Repository.Root.Path, "/", name)) as RefTestNode;
            if (rtn == null)
            {
                rtn = new RefTestNode(Repository.Root);
                rtn.Name = name;
                rtn.Save();
            }
            return rtn;
        }
Ejemplo n.º 4
0
		public RefTestNode CreateRefTestNode(string name)
		{
			RefTestNode rtn = Node.LoadNode(string.Concat(this.TestRoot.Path, "/", name)) as RefTestNode;
            if (rtn != null)
                rtn.ForceDelete();
			rtn = new RefTestNode(this.TestRoot);
			rtn.Name = name;
			rtn.Save();

			return rtn;
		}