public void Publish(Message e, string topicName) { if (e != null) { if (topicName.CompareTo(EntityType.CrewMember.ToString()) == 0) { CrewMembers.Clear(); foreach (IdentifiedObject item in e.IdObjCollection) { CrewMembers.Add(item as CrewMember); } return; } if (topicName.CompareTo(EntityType.Crew.ToString()) == 0) { Crews.Clear(); foreach (IdentifiedObject item in e.IdObjCollection) { Crews.Add(item as Crew); } return; } } }
public void AddCrewMembersToList(IEnumerable <GnApiProgramsSchema.crewTypeMember> crewList, string apiLevel, bool updateTracker = false) { var crewTypeMembers = crewList.ToList(); if (crewTypeMembers.Any()) { if (CrewMembers == null) { CrewMembers = new List <GnApiProgramsSchema.crewTypeMember>(); } if (!updateTracker) { Log.Debug($"Number of Crew Members at {apiLevel} Level: {crewTypeMembers.Count()}"); } foreach (var crew in crewTypeMembers) { CrewMembers.Add(crew); } } else { if (!updateTracker) { Log.Warn($"Crew info is currently null at the current api level: {apiLevel}, " + "will continue and check next api results for Crew data"); } } }
public Crew() { Console.WriteLine("What is the name of your crew?"); Name = Console.ReadLine(); var run = true; while (run) { var x = new TeamMember(); if (x.Name == "") { break; } CrewMembers.Add(x); if (CrewMembers.Count == 1) { Console.WriteLine($"There is now 1 member in {Name}."); } else { Console.WriteLine($"There are now {CrewMembers.Count} members in {Name}."); } } var cumulativeSkill = 0; CrewMembers.ForEach((member) => cumulativeSkill += member.SkillLevel); CumulativeSkill = cumulativeSkill; }
private void AddAllCommand_Execute(object parameter) { foreach (var item in AllMembers) { CrewMembers.Add(item); } AllMembers.Clear(); }
private void AddToCrewCommand_Execute(object parameter) { foreach (var item in SelectedMembers) { CrewMembers.Add(item); } SelectedMembers.Clear(); foreach (var item in CrewMembers) { AllMembers.Remove(item); } }