Esempio n. 1
0
 internal void FireChildrenInvalidated(RowVM row)
 {
     var p = ChildrenInvalidated; if (p != null)
     {
         p(row);
     }
 }
Esempio n. 2
0
 internal void FireRowInvalidated(RowVM row)
 {
     var p = RowInvalidated; if (p != null)
     {
         p(row);
     }
 }
Esempio n. 3
0
		void AutoRefresh(RowVM row, bool structureChanged)
		{
			if (structureChanged)
				_structureChanges.Add(row);
			if (!_refreshing) {
				_treeView.BeginInvoke(new Action(DoRefresh));
				_refreshing = true;
			}
		}
Esempio n. 4
0
		void FireStructureChangedUnder(RowVM row)
		{
			if (row == null) { // roots changed
				// Reestablish dependencies from model to ViewModel
				_tree.Roots.DependentSentry.OnGet();
				StructureChanged(this, new TreePathEventArgs());
			} else {
				// Reestablish dependencies from model to ViewModel
				row.Children.DependentSentry.OnGet();
				TreePath path;
				if (row.Model.Parent == null)
					path = new TreePath(row);
				else {
					var list = new DList<RowVM>();
					for (; row != null; row = row.Parent)
						list.PushFirst(row);
					path = new TreePath(list.ToArray());
				}
				StructureChanged(this, new TreePathEventArgs(path));
			}
		}
Esempio n. 5
0
        //DisplaySettingsVM _settings;

        public RowVM(RowModel model, ProjectVM tree, RowVM parent) : base(model)
        {
            Tree   = tree;
            Parent = parent;
            //_settings = settings;
            //settings.PropertyChanged += new PropertyChangedEventHandler(Settings_PropertyChanged);

            _children = new DependentList <RowVM>(() => Tree.Filter.ApplyTo(model.Children).Select(m => new RowVM(m, Tree, this)));
            _children.DependentSentry.Invalidated += () => Tree.FireChildrenInvalidated(this);
            _depChangeDetector = Dependent.New("RowVM._depChangeDetector", () => {
                // Watch for changes in any of the model's properties,
                // to trigger a screen refresh when using TreeViewAdv
                var a = Model.Type;
                var b = Model.Name;
                var c = Model.Status;
                var d = Model.Priority;
                var e = Model.RunTime;
                var f = Model.Summary;
            });
            _depChangeDetector.Invalidated += () => Tree.FireRowInvalidated(this);
        }