Esempio n. 1
0
        private void MenuItem_New(object sender, RoutedEventArgs e)
        {
            TreeViewModel treeViewModel = this.ViewModel.New();

            this.lbTrees.SelectedItem = treeViewModel;
            this.treeView.ViewModel   = treeViewModel;
        }
Esempio n. 2
0
        private void MenuItem_New(object sender, RoutedEventArgs e)
        {
            TreeViewModel treeViewModel = new TreeViewModel(this.ViewModel);

            this.ViewModel.Add(treeViewModel);
            this.treeView.ViewModel = treeViewModel;
        }
Esempio n. 3
0
		private void MenuItem_Open(object sender, RoutedEventArgs e)
		{
			string nodePath = Path.Combine(ConfigurationManager.AppSettings["NodePath"], "TreeProto.txt");
			this.ViewModel.Open(nodePath);
			this.lbTrees.SelectedIndex = -1;
			this.treeView.ViewModel = null;
		}
Esempio n. 4
0
        private void MenuItem_Open(object sender, RoutedEventArgs e)
        {
            string nodePath = ConfigurationManager.AppSettings["NodePath"];

            this.ViewModel.Open(nodePath);
            this.lbTreeRoots.SelectedIndex = -1;
            this.treeView.ViewModel        = null;
        }
Esempio n. 5
0
        private void MenuItem_Open(object sender, RoutedEventArgs e)
        {
            string nodePath = Path.Combine(ConfigurationManager.AppSettings["NodePath"], "TreeProto.txt");

            this.ViewModel.Open(nodePath);
            this.lbTrees.SelectedIndex = -1;
            this.treeView.ViewModel    = null;
        }
Esempio n. 6
0
		private void MenuItem_Clone(object sender, RoutedEventArgs e)
		{
			if (this.lbTrees.SelectedItem == null)
			{
				return;
			}
			TreeViewModel treeViewModel = this.lbTrees.SelectedItem as TreeViewModel;
			TreeViewModel newTreeViewModel = this.ViewModel.Clone(treeViewModel);
			this.treeView.ViewModel = newTreeViewModel;
		}
Esempio n. 7
0
        private void MenuItem_Clone(object sender, RoutedEventArgs e)
        {
            if (this.lbTrees.SelectedItem == null)
            {
                return;
            }
            TreeViewModel treeViewModel    = this.lbTrees.SelectedItem as TreeViewModel;
            TreeViewModel newTreeViewModel = this.ViewModel.Clone(treeViewModel);

            this.treeView.ViewModel = newTreeViewModel;
        }
Esempio n. 8
0
        public TreeViewModel(AllTreeViewModel allTreeViewModel)
        {
            this.AllTreeViewModel = allTreeViewModel;
            this.TreeId           = ++allTreeViewModel.MaxTreeId;
            TreeNodeViewModel treeNodeViewModel = new TreeNodeViewModel(this, 300, 100);

            this.treeNodes.Add(treeNodeViewModel);
            this.treeNodeDict[treeNodeViewModel.Id] = treeNodeViewModel;

            var treeLayout = new TreeLayout(this);

            treeLayout.ExcuteLayout();
        }
Esempio n. 9
0
        private void ListBoxItem_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var item = (FrameworkElement)sender;
            var treeNodeViewModel = item.DataContext as TreeNodeViewModel;

            if (this.treeView.ViewModel != null)
            {
                if (this.treeView.ViewModel.TreeId == treeNodeViewModel.TreeId)
                {
                    return;
                }
            }
            this.treeView.ViewModel = this.ViewModel.Get(treeNodeViewModel.TreeId);
        }
Esempio n. 10
0
        private void ListBoxItem_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement item          = (FrameworkElement)sender;
            TreeViewModel    treeViewModel = item.DataContext as TreeViewModel;

            if (this.treeView.ViewModel != null)
            {
                if (this.treeView.ViewModel.Id == treeViewModel.Id)
                {
                    return;
                }
            }
            this.lbTrees.SelectedItem = treeViewModel;
            this.treeView.ViewModel   = treeViewModel;
        }
Esempio n. 11
0
		private void MenuItem_New(object sender, RoutedEventArgs e)
		{
			TreeViewModel treeViewModel = this.ViewModel.New();
			this.lbTrees.SelectedItem = treeViewModel;
			this.treeView.ViewModel = treeViewModel;
		}
Esempio n. 12
0
		private void ListBoxItem_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
		{
			FrameworkElement item = (FrameworkElement) sender;
			TreeViewModel treeViewModel = item.DataContext as TreeViewModel;
			if (this.treeView.ViewModel != null)
			{
				if (this.treeView.ViewModel.Id == treeViewModel.Id)
				{
					return;
				}
			}
			this.lbTrees.SelectedItem = treeViewModel;
			this.treeView.ViewModel = treeViewModel;
		}