コード例 #1
0
ファイル: Data.cs プロジェクト: samgerene/gong-wpf-dragdrop
        public Data()
        {
            this.Collection1 = new ObservableCollection<string>();
            this.Collection2 = new ObservableCollection<string>();

            for (var n = 0; n < 100; ++n)
            {
                this.Collection1.Add("Item " + n);
            }

            this.GroupedCollection = new ObservableCollection<GroupedItem>();
            for (var g = 0; g < 4; ++g)
            {
                for (var i = 0; i < 2; ++i)
                {
                    this.GroupedCollection.Add(new GroupedItem("Group " + g, "Group " + g + " Item " + i));
                }
            }

            var root1 = new TreeNode("Root 1");
            for (var n = 0; n < 10; ++n)
            {
                root1.Children.Add(new TreeNode("Item " + n));
            }

            var root2 = new TreeNode("Root 2");
            for (var n = 0; n < 4; ++n)
            {
                root2.Children.Add(new TreeNode("Item " + (n + 10)));
            }

            this.TreeCollection = new ObservableCollection<TreeNode> {
                                                                         root1, root2
                                                                     };
        }
コード例 #2
0
        public Data()
        {
            Collection1 = new ObservableCollection<string>();
            Collection2 = new ObservableCollection<string>();

            for (int n = 0; n < 100; ++n)
            {
                Collection1.Add("Item " + n);
            }

            GroupedCollection = new ObservableCollection<GroupedItem>();
            for (int g = 0; g < 4; ++g)
            {
                for (int i = 0; i < 2; ++i)
                {
                    GroupedCollection.Add(new GroupedItem("Group " + g, "Group " + g + " Item " + i));
                }
            }

            TreeNode root1 = new TreeNode("Root 1");
            for (int n = 0; n < 10; ++n)
            {
                root1.Children.Add(new TreeNode("Item " + n));
            }

            TreeNode root2 = new TreeNode("Root 2");
            for (int n = 0; n < 4; ++n)
            {
                root2.Children.Add(new TreeNode("Item " + (n + 10)));
            }

            TreeCollection = new ObservableCollection<TreeNode>
            {
                root1, root2
            };
        }
コード例 #3
0
    public Data()
    {
      this.Collection1 = new ObservableCollection<string>();
      this.Collection2 = new ObservableCollection<string>();
      this.Collection3 = new ObservableCollection<string>();
      this.Collection4 = new ObservableCollection<string>();
      this.CustomCollection1 = new ObservableCollection<CustomDataModel>();
      this.CustomCollection2 = new ObservableCollection<CustomDataModel>();
      this.ClonableCollection1 = new ObservableCollection<ClonableDataModel>();
      this.ClonableCollection2 = new ObservableCollection<ClonableDataModel>();

      this.CustomDropHandler = new CustomDropHandlerForIssue85();
      this.CustomDragHandler = new CustomDragHandlerForIssue84();

      for (var n = 0; n < 100; ++n) {
        this.Collection1.Add("Item " + n);
        this.CustomCollection1.Add(new CustomDataModel { Name = "Custom Item " + n });
        this.ClonableCollection1.Add(new ClonableDataModel("Clonable Item " + n ));
      }

      for (var n = 0; n < 4; ++n) {
        this.Collection4.Add("Content " + n);
      }

      this.GroupedCollection = new ObservableCollection<GroupedItem>();
      for (var g = 0; g < 4; ++g) {
        for (var i = 0; i < 2; ++i) {
          this.GroupedCollection.Add(new GroupedItem("Group " + g, "Group " + g + " Item " + i));
        }
      }

      var root1 = new TreeNode("Root 1");
      for (var n = 0; n < 10; ++n) {
        root1.Children.Add(new TreeNode("Item " + n));
      }

      var root2 = new TreeNode("Root 2");
      for (var n = 0; n < 4; ++n) {
        root2.Children.Add(new TreeNode("Item " + (n + 10)));
      }

      this.TreeCollection = new ObservableCollection<TreeNode> {
                                                                 root1, root2
                                                               };
      this.TreeCollection2 = new ObservableCollection<TreeNode>();
    }
コード例 #4
0
 public object Clone()
 {
   var treeNode = new TreeNode(this.Caption);
   foreach (var child in this.Children)
   {
     treeNode.Children.Add((TreeNode) child.Clone());
   }
   return treeNode;
 }