public ProfileManagementModels(string[] userInformation) { this.AvatarSectionModel = new AvatarSectionViewModel() { AvatarSource = userInformation[0] }; this.PersonalPhraseModel = new PersonalPhraseViewModel() { PersonalPhrase = userInformation[1], PhraseColor = userInformation[2] }; this.InformationSectionModel = new InformationSectionViewModel() { UserName = userInformation[3], Email = userInformation[4], RegistrationDate = userInformation[5] }; this.ChangePasswordSectionModel = new ChangePasswordSectionViewModel(); }
public ProfileManagementModels(string[] userInformation, object sectionModel) { this.AvatarSectionModel = new AvatarSectionViewModel() { AvatarSource = userInformation[0] }; this.PersonalPhraseModel = new PersonalPhraseViewModel() { PersonalPhrase = userInformation[1], PhraseColor = userInformation[2] }; this.InformationSectionModel = new InformationSectionViewModel() { UserName = userInformation[3], Email = userInformation[4], RegistrationDate = userInformation[5] }; this.ChangePasswordSectionModel = new ChangePasswordSectionViewModel(); //if (sectionModel is AvatarSectionViewModel) // this.AvatarSectionModel = (AvatarSectionViewModel)sectionModel; if (sectionModel is PersonalPhraseViewModel) { this.PersonalPhraseModel = (PersonalPhraseViewModel)sectionModel; } if (sectionModel is InformationSectionViewModel) { this.InformationSectionModel = (InformationSectionViewModel)sectionModel; } if (sectionModel is ChangePasswordSectionViewModel) { this.ChangePasswordSectionModel = (ChangePasswordSectionViewModel)sectionModel; } }