示例#1
0
        /// <summary>
        /// Notify that everything has been saved and create a save point in the action stack.
        /// </summary>
        internal void NotifySave()
        {
            service.NotifySave();
            transactions.ForEach(x => x.NotifySave());
            transactions.ForEach(x => x.IsSavePoint = false);
            var savePoint = transactions.LastOrDefault(x => x.IsSaved);

            if (savePoint != null)
            {
                savePoint.IsSavePoint = true;
            }
        }
示例#2
0
        public void ResetFilter()
        {
            nodes.BeginUpdate();

            nodes.ForEach(SetVisible);

            nodes.EndUpdate();
        }
示例#3
0
        /// <summary>
        /// Notify that everything has been saved and create a save point in the action stack.
        /// </summary>
        public void NotifySave()
        {
            savePoint = ActionStack.CreateSavePoint(true);
            actionItems.ForEach(x => x.IsSavePoint = x.ActionItem.Identifier == savePoint.ActionItemIdentifier);
            var dirtiableManager = ServiceProvider.TryGet <DirtiableManager>();

            dirtiableManager.NotifySave();
        }
示例#4
0
 /// <summary>
 /// 节点排序
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="nodes"></param>
 /// <param name="comparison"></param>
 private void ApplyNodesSort <T>(ObservableList <TreeNode <T> > nodes, Comparison <TreeNode <T> > comparison)
 {
     nodes.Sort(comparison);
     nodes.ForEach(node => {
         if (node.Nodes != null)
         {
             ApplyNodesSort(node.Nodes as ObservableList <TreeNode <T> >, comparison);
         }
     });
 }
        private void ClearCalculationOutputAndNotifyObservers(LocationCalculationsView <T> view)
        {
            ObservableList <HydraulicBoundaryLocationCalculation> calculations = GetCalculationsInView(view);

            calculations.ForEach(calculation =>
            {
                calculation.Output = null;
                calculation.NotifyObservers();
            });
        }
示例#6
0
        /// <summary>
        /// Toggle nodes state.
        /// </summary>
        /// <param name="nodes">Nodes list.</param>
        /// <param name="isExpanded">Expanded state.</param>
        public void ToggleNodes(ObservableList <TreeNode <TreeViewItem> > nodes, bool isExpanded)
        {
            if ((nodes == null) || (nodes.Count == 0))
            {
                return;
            }

            nodes.BeginUpdate();

            nodes.ForEach(node =>
            {
                node.IsExpanded = isExpanded;
                ToggleNodes(node.Nodes, isExpanded);
            });

            nodes.EndUpdate();
        }
示例#7
0
 /// <summary>
 /// Notify that everything has been saved and create a save point in the action stack.
 /// </summary>
 public void NotifySave()
 {
     savePoint = actionStack.CreateSavePoint(true);
     actionItems.ForEach(x => x.IsSavePoint = x.ActionItem.Identifier == savePoint.ActionItemIdentifier);
 }