예제 #1
0
 /// <summary>
 /// 移除节点关系对象(不会移除节点以及节点的关联)
 /// </summary>
 /// <param name="nodeRelationShip"></param>
 public void RemoveNodeRelationShip(NodeRelationShip nodeRelationShip)
 {
     if (nodeRelationShip != null)
     {
         nodeRelationShipList.Remove(nodeRelationShip);
     }
 }
예제 #2
0
        /// <summary>
        /// 移除指定id之间的关系(包括附加的关系-->前置以及互斥)
        /// </summary>
        /// <param name="id1"></param>
        /// <param name="id2"></param>
        public void DeleteRelationShip(int id1, int id2)
        {
            NodeRelationShip nodeRelationShip = GetNodeRelationShip(id1, id2);

            RemoveNodeRelationShip(nodeRelationShip);
            MapElement <TaskInfoStruct> taskInfoNode1 = GetElement(id1);
            MapElement <TaskInfoStruct> taskInfoNode2 = GetElement(id2);

            if (taskInfoNode1 != null && taskInfoNode2 != null)
            {
                taskInfoNode1.CorrelativesNode.Remove(taskInfoNode2);
            }
        }
예제 #3
0
        /// <summary>
        /// 创建节点关系
        /// </summary>
        /// <param name="id1"></param>
        /// <param name="id2"></param>
        /// <returns></returns>
        public NodeRelationShip CreateNodeRelationShip(int id1, int id2)
        {
            NodeRelationShip nodeRelationShip = GetNodeRelationShip(id1, id2);

            if (nodeRelationShip == null)
            {
                nodeRelationShip               = new NodeRelationShip();
                nodeRelationShip.StartID       = id1;
                nodeRelationShip.EndID         = id2;
                nodeRelationShip.JudgingStatus = Enums.EnumTaskProgress.Sucessed;
                nodeRelationShipList.Add(nodeRelationShip);
            }
            return(nodeRelationShip);
        }