private void AddFriendButton_Click(object sender, RoutedEventArgs e) { //TODO: new friends picker User r; do { r = AllUsers[Generate.Int(AllUsers.Count)]; }while (ActiveUserSubscriptions.Contains(r) || ActiveUser == r); ActiveUser.Subscribe(r); UpdateCollections(); }
public async Task <Person> FillBlanks(eGender PersonGender) { switch (PersonGender) { case eGender.Male: { if (MaleFirstNames.Count == 0) { MaleFirstNames = (await ReadFile(@"=malefirstnames.txt")).ToList(); } if (MaleLastNames.Count == 0) { MaleLastNames = (await ReadFile(@"=malelastnames.txt")).ToList(); } First = MaleFirstNames[Generate.Int(MaleFirstNames.Count)]; Last = MaleLastNames[Generate.Int(MaleLastNames.Count)]; break; } case eGender.Female: { if (FemaleFirstNames.Count == 0) { FemaleFirstNames = (await ReadFile(@"=femalefirstnames.txt")).ToList(); } if (FemaleLastNames.Count == 0) { FemaleLastNames = (await ReadFile(@"=femalelastnames.txt")).ToList(); } First = FemaleFirstNames[Generate.Int(FemaleFirstNames.Count)]; Last = FemaleLastNames[Generate.Int(FemaleLastNames.Count)]; break; } } this.PersonGender = PersonGender; DateOfBirth = Generate.NewDateTime(new DateTime(1970, 1, 1), DateTime.UtcNow); RelationshipStatus = (eRelationshipStatus)Generate.Int(4); return(this); }
public new static async Task <User> MakeNew() => await MakeNew((eGender)Generate.Int(2));
public static async Task <Person> MakeNew() => await MakeNew((eGender)Generate.Int(2));
public async Task <Person> FillBlanks(eGender PersonGender) { switch (PersonGender) { case eGender.Male: { if (MaleFirstNames.Count == 0) { MaleFirstNames = (await ReadFile(@"=malefirstnames.txt")).ToList(); } if (MaleLastNames.Count == 0) { MaleLastNames = (await ReadFile(@"=malelastnames.txt")).ToList(); } First = MaleFirstNames[Generate.Int(MaleFirstNames.Count)]; Last = MaleLastNames[Generate.Int(MaleLastNames.Count)]; break; } case eGender.Female: { if (FemaleFirstNames.Count == 0) { FemaleFirstNames = (await ReadFile(@"=femalefirstnames.txt")).ToList(); } if (FemaleLastNames.Count == 0) { FemaleLastNames = (await ReadFile(@"=femalelastnames.txt")).ToList(); } First = FemaleFirstNames[Generate.Int(FemaleFirstNames.Count)]; Last = FemaleLastNames[Generate.Int(FemaleLastNames.Count)]; break; } } this.PersonGender = PersonGender; DateOfBirth = Generate.NewDateTime(new DateTime(1970, 1, 1), new DateTime(DateTime.UtcNow.Subtract(new DateTime(15, 1, 1)).Ticks)); RelationshipStatus = (eRelationshipStatus)Generate.Int(4); switch (Generate.Int(3)) { case 0: School = "Школа"; break; case 1: School = "Лицей"; break; case 2: School = "Гимназия"; break; } School += " №" + Generate.Int(38, 147); switch (Generate.Int(6)) { case 0: University = "НИУ ВШЭ"; break; case 1: University = "СПБГУ"; break; case 2: University = "МГУ"; break; case 3: University = "ИТМО"; break; case 4: University = "МГИМО"; break; case 5: University = "МФТИ"; break; } return(this); }