Inheritance: INotifyPropertyChanged
コード例 #1
0
        private void resetData()
        {
            do
            {
                _theThing = new TreeViewDataItem(DataTree.GetRandomDataTree(5, 5), "Children");
            }while (_theThing.Children.Count < 3);

            treeView.ItemsSource = _theThing.Children;
        }
コード例 #2
0
        internal TreeViewDataItem(object dataItem, string childrenPropertyName, TreeViewDataItem parent)
        {
            if (dataItem == null)
            {
                throw new ArgumentNullException("dataItem");
            }
            if (childrenPropertyName == null)
            {
                throw new ArgumentNullException("childrenPropertyName");
            }

            _dataItem = dataItem;
            _childrenPropertyName = childrenPropertyName;
            _parent = parent;
        }
コード例 #3
0
        internal TreeViewDataItem(object dataItem, string childrenPropertyName, TreeViewDataItem parent)
        {
            if (dataItem == null)
            {
                throw new ArgumentNullException("dataItem");
            }
            if (childrenPropertyName == null)
            {
                throw new ArgumentNullException("childrenPropertyName");
            }

            _dataItem             = dataItem;
            _childrenPropertyName = childrenPropertyName;
            _parent = parent;
        }
コード例 #4
0
 private static object[] getRandomObjectPath(TreeViewDataItem thing)
 {
     List<TreeViewDataItem> path = new List<TreeViewDataItem>();
     Random rnd = new Random();
     while (thing != null)
     {
         if (thing.Children.Count > 0)
         {
             thing = thing.Children[rnd.Next(thing.Children.Count)];
             path.Add(thing);
         }
         else
         {
             thing = null;
         }
     }
     return path.ToArray();
 }
コード例 #5
0
        private static object[] getRandomObjectPath(TreeViewDataItem thing)
        {
            List <TreeViewDataItem> path = new List <TreeViewDataItem>();
            Random rnd = new Random();

            while (thing != null)
            {
                if (thing.Children.Count > 0)
                {
                    thing = thing.Children[rnd.Next(thing.Children.Count)];
                    path.Add(thing);
                }
                else
                {
                    thing = null;
                }
            }
            return(path.ToArray());
        }
コード例 #6
0
 private static int[] getRandomIntPath(TreeViewDataItem thing)
 {
     List<int> path = new List<int>();
     Random rnd = new Random();
     while (thing != null)
     {
         if (thing.Children.Count > 0)
         {
             int index = rnd.Next(thing.Children.Count);
             thing = thing.Children[index];
             path.Add(index);
         }
         else
         {
             thing = null;
         }
     }
     return path.ToArray();
 }
コード例 #7
0
        private static int[] getRandomIntPath(TreeViewDataItem thing)
        {
            List <int> path = new List <int>();
            Random     rnd  = new Random();

            while (thing != null)
            {
                if (thing.Children.Count > 0)
                {
                    int index = rnd.Next(thing.Children.Count);
                    thing = thing.Children[index];
                    path.Add(index);
                }
                else
                {
                    thing = null;
                }
            }
            return(path.ToArray());
        }
コード例 #8
0
        private void resetData()
        {
            do
            {
                _theThing = new TreeViewDataItem(DataTree.GetRandomDataTree(5, 5), "Children");
            }
            while (_theThing.Children.Count < 3);

            treeView.ItemsSource = _theThing.Children;
        }