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; } } }
private void RemoveAllCommand_Execute(object parameter) { foreach (var item in CrewMembers) { AllMembers.Add(item); } CrewMembers.Clear(); }
private void AddEntityCommand_Execute(object parameter) { crew.Members.AddRange((from item in CrewMembers select item.GlobalId).ToList()); Client.AddEntity(crew); Crews.Add(crew); crew = new Crew(); CrewName = string.Empty; CrewMembers.Clear(); }