Пример #1
0
 public ActivityEdge(int id, EventVertex source, EventVertex target, Activity activity, bool isCritical)
 {
     this.Id = id;
     this.Source = source;
     this.Target = target;
     this.Activity = activity;
     this.IsCritical = isCritical;
 }
        private ActivityEdge CreateActivityEdge(EventVertex source, EventVertex target, Activity edgeActivity, bool isCritical)
        {
            var edgeUniqueKey = new Tuple<int, int>(source.Id, target.Id);
            int activityEdgeId;
            if (!edgesIdsMap.TryGetValue(edgeUniqueKey, out activityEdgeId))
            {
                edgesIdsMap[edgeUniqueKey] = activityEdgeId = edgesNextId;
                edgesNextId++;
            }

            return new ActivityEdge(activityEdgeId, source, target, edgeActivity, isCritical);
        }
 public ActivityDependency(Activity activity, List<int> predecessors)
 {
     this.Activity = activity;
     this.Predecessors = predecessors.AsReadOnly();
 }
 private bool TryGetActivity(InternalEventVertex vertex, out Activity activity)
 {
     activity = null;
     return activitiesDictionary.TryGetValue(vertex.ActivityId, out activity);
 }
        private bool TryGetActivity(InternalActivityEdge edge, out Activity activity)
        {
            activity = null;
            if (edge.ActivityId.HasValue && activitiesDictionary.ContainsKey(edge.ActivityId.Value))
            {
                activity = activitiesDictionary[edge.ActivityId.Value];
                return true;
            }

            return false;
        }
Пример #6
0
 public static EventVertex CreateMilestone(int id, Activity milestoneActivity)
 {
     return new EventVertex(id, milestoneActivity);
 }
Пример #7
0
 private EventVertex(int id, Activity milestoneActivity)
     : this(id, EventVertexType.Milestone)
 {
     this.MilestoneActivity = milestoneActivity;
 }