コード例 #1
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var itemList = new PNTreeViewItemList();

            var node1 = new test_data_rpc()
            {
                type = PNItemType.BOLE,
                id   = Guid.NewGuid().ToString(),
                name = "Node No.1",
                desc = "This is the discription of Node1. This is a folder.",
            };

            var node1tag1 = new test_data_rpc(node1)
            {
                type = PNItemType.LEAF,
                id   = Guid.NewGuid().ToString(),
                name = "Tag No.1",
                desc = "This is the discription of Tag 1. This is a tag.",
            };

            var node1tag2 = new test_data_rpc(node1)
            {
                type = PNItemType.LEAF,
                id   = Guid.NewGuid().ToString(),
                name = "Tag No.2",
                desc = "This is the discription of Tag 2. This is a tag.",
            };

            new test_data_rpc(node1tag2)
            {
                type = PNItemType.BOLE,
                id   = Guid.NewGuid().ToString(),
                name = "DDD",
                desc = "",
            };

            itemList.Add(new TestData(node1));

            var node2 = new test_data_rpc()
            {
                type = PNItemType.BOLE,
                id   = Guid.NewGuid().ToString(),
                name = "Node No.2",
                desc = "This is the discription of Node 2. This is a folder.",
            };

            var node2tag3 = new test_data_rpc(node2)
            {
                type = PNItemType.LEAF,
                id   = Guid.NewGuid().ToString(),
                name = "Tag No.3",
                desc = "This is the discription of Tag 3. This is a tag.",
            };

            itemList.Add(new TestData(node2));

            this.treeView.ItemsSource = itemList;
            _item_list = itemList;
        }
コード例 #2
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
        public TestData(test_data_rpc data, TestData parent = null) : base(parent)
        {
            _data = data;
            TestData tmp;

            foreach (var element in data.children)
            {
                tmp = new TestData(element, this);
            }
        }
コード例 #3
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
 public TestData(test_data_rpc data, TestData parent = null)
     : base(parent)
 {
     _data = data;
     TestData tmp;
     foreach(var element in data.children)
     {
         tmp = new TestData(element, this);
     }
 }
コード例 #4
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
        public test_data_rpc(test_data_rpc parent = null)
        {
            test_p p = new test_p();

            p.Name      = "1";
            this.parent = parent;
            children    = new List <test_data_rpc>();
            if (this.parent != null)
            {
                parent.children.Add(this);
            }
        }
コード例 #5
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
 public test_data_rpc(test_data_rpc parent = null)
 {
     test_p p = new test_p();
     p.Name = "1";
     this.parent = parent;
     children = new List<test_data_rpc>();
     if (this.parent != null)
         parent.children.Add(this);
 }
コード例 #6
0
ファイル: TestPage.xaml.cs プロジェクト: srdgame/wpf_test
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var itemList = new PNTreeViewItemList();

            var node1 = new test_data_rpc()
            {
                type = PNItemType.BOLE,
                id = Guid.NewGuid().ToString(),
                name = "Node No.1",
                desc = "This is the discription of Node1. This is a folder.",
            };

            var node1tag1 = new test_data_rpc(node1)
            {
                type = PNItemType.LEAF,
                id = Guid.NewGuid().ToString(),
                name = "Tag No.1",
                desc = "This is the discription of Tag 1. This is a tag.",
            };

            var node1tag2 = new test_data_rpc(node1)
            {
                type = PNItemType.LEAF,
                id = Guid.NewGuid().ToString(),
                name = "Tag No.2",
                desc = "This is the discription of Tag 2. This is a tag.",
            };

            new test_data_rpc(node1tag2)
            {
                type = PNItemType.BOLE,
                id = Guid.NewGuid().ToString(),
                name = "DDD",
                desc = "",
            };

            itemList.Add(new TestData(node1));

            var node2 =  new test_data_rpc()
                {
                    type = PNItemType.BOLE,
                    id = Guid.NewGuid().ToString(),
                    name = "Node No.2",
                    desc = "This is the discription of Node 2. This is a folder.",
            };

            var node2tag3 = new test_data_rpc(node2)
                {
                    type = PNItemType.LEAF,
                    id = Guid.NewGuid().ToString(),
                    name = "Tag No.3",
                    desc = "This is the discription of Tag 3. This is a tag.",
            };

            itemList.Add(new TestData(node2));

            this.treeView.ItemsSource = itemList;
            _item_list = itemList;
        }