PersonListModel.cs CampusAppWP8::Model::Person::PersonListModel CampusAppWP8::Model::Person //----------------------------------------------------------------------------- //<copyrightfile="PersonListModel.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>stubbfel</author> //<sience>05.09.2013</sience> //----------------------------------------------------------------------------- namespaceCampusAppWP8.Model.Person { usingSystem.Collections.Generic; usingSystem.Collections.ObjectModel; usingSystem.Xml.Serialization; [XmlRoot("Uebersicht")] publicclassPersonListModel { #regionProperty [XmlElement("person")] publicObservableCollection<PersonModel>Persons{get;set;} #endregion #regionMethod publicvoidSetPersonIdToFunction() { foreach(PersonModelpersoninthis.Persons) { person.SetPersonIdToFunction(); } } publicPersonModelGetPerson(stringid) { foreach(PersonModeltmpPersoninthis.Persons) { if(tmpPerson.ID.Equals(id)) { returntmpPerson; } } returnnull; } publicvoidRemoveNonFunctionAndSetIdsPerson() { this.RemoveNonFunctionPerson(); this.SetPersonIdToFunction(); } publicvoidRemoveNonFunctionPerson() { List<PersonModel>removeList=newList<PersonModel>(); foreach(PersonModeltmpPersoninthis.Persons) { if(tmpPerson.Functions.Count<1) { removeList.Add(tmpPerson); } } foreach(PersonModelremovePersoninremoveList) { this.Persons.Remove(removePerson); } } #endregion } }