示例#1
0
        public CriterionNode AddCriterionNode(string name, decimal weight)
        {
            var node = new CriterionNode(name, weight);

            AddCriterionNode(node);

            return(node);
        }
示例#2
0
 public void RemoveCriterionNode(CriterionNode node)
 {
     if (ContainsCriterionNode(node))
     {
         if (node.GoalNode != null)
         {
             node.GoalNode.RemoveCriterionNode(node);
         }
         else if (node.ParentCriterionNode != null)
         {
             node.ParentCriterionNode.RemoveSubcriterionNode(node);
         }
     }
 }
示例#3
0
        public void AddSubcriterionNode(CriterionNode node)
        {
            if (Hierarchy == null)
            {
                throw new InvalidOperationException("Can not add subcriterion node when Hierarchy is null.");
            }

            if (AlternativeNodes.Count > 0)
            {
                ClearChildNodes();
            }

            AddChildNode(node);
            node.RefreshAlternativeNodes();
        }
示例#4
0
 public void RemoveCriterionNode(CriterionNode node)
 {
     RemoveChildNode(node);
 }
示例#5
0
 public void AddCriterionNode(CriterionNode node)
 {
     AddChildNode(node);
     node.RefreshAlternativeNodes();
 }
示例#6
0
 public bool ContainsCriterionNode(CriterionNode node)
 {
     return(GoalNode.SearchChildNodes <CriterionNode>(x => x == node).Count == 1);
 }