private async void AnimationSwitch_Toggled(object sender, ToggledEventArgs e) { if (!task) { task = true; var controller = new JsonController("setting"); try { var dict = new Dictionary <string, object>(); dict.Add("Animation", AnimationSwitch.IsToggled); controller.Add(dict); } catch (Exception ex) { await MainPage.GetInstance().ErrorAlert("설정 변경", "애니메이션 설정을 변경하는 도중 오류가 발생했습니다.\n" + ex.Message); } var read = controller.Read(); App.Animation = Convert.ToBoolean(read["Animation"]); task = false; } }
private async void Forward_Clicked(object sender, System.EventArgs e) { if (!task) { if (page == PAGE_MAX) { task = true; Back.IsVisible = false; Forward.IsVisible = false; Page2Label4.IsVisible = true; Page2Label4.Opacity = 0; await Page2Label4.FadeTo(1, 1000, Easing.SpringIn); var controller = new JsonController("setting"); try { var dict = new Dictionary <string, object>(); dict.Add("Setup", true); controller.Add(dict); } catch (Exception ex) { await DisplayAlert("초기 설정", "초기 설정을 완료하는 도중 오류가 발생했습니다.\n" + ex.Message, "확인"); } var read = controller.Read(); App.Setup = Convert.ToBoolean(read["Setup"]); Application.Current.MainPage = new MainPage(); DependencyService.Get <IToastMessage>().Longtime("이제 한양이 앱을 사용해보세요 !\n설정 탭에서 여러 가지를 설정할 수 있습니다."); task = false; } else if (page < PAGE_MAX) { task = true; page++; NavigatePage(); task = false; } } }
private async void GoSetting_Clicked(object sender, EventArgs e) { if (!task) { task = true; var popup = new ProfileSettingPopup(); popup.OnPopupSaved += async(s, arg) => { if (arg.Result) { var controller = new JsonController("setting"); var read = controller.Read(); if (read != null) { try { var dict = new Dictionary <string, object> { { "Grade", arg.Grade }, { "Class", arg.Class }, { "Number", arg.Number }, { "Name", arg.Name }, { "BirthMonth", arg.BirthMonth }, { "BirthDay", arg.BirthDay } }; controller.Add(dict); } catch (Exception ex) { await DisplayAlert("설정", "설정을 완료하는 도중 오류가 발생했습니다.\n" + ex.Message, "확인"); } } else { var jsonObj = new JObject( new JProperty("Grade", arg.Grade), new JProperty("Class", arg.Class), new JProperty("Number", arg.Number), new JProperty("Name", arg.Name), new JProperty("BirthMonth", arg.BirthMonth), new JProperty("BirthDay", arg.BirthDay)); await controller.Write(jsonObj); } App.Grade = arg.Grade; App.Class = arg.Class; App.Number = arg.Number; App.Name = arg.Name; App.BirthMonth = arg.BirthMonth; App.BirthDay = arg.BirthDay; DependencyService.Get <IToastMessage>().Longtime("입력된 정보가 저장되었습니다."); Page2Label2.Text = "프로필 다시 설정하기"; Forward.IsVisible = true; Page2Label3.IsVisible = true; Page2Label3.Opacity = 0; await Page2Label3.FadeTo(1, 1000, Easing.SpringIn); } }; await PopupNavigation.Instance.PushAsync(popup, App.Animation); task = false; } }
private async void ProfileButton_Clicked(object sender, EventArgs e) { if (!task) { task = true; var popup = new ProfileSettingPopup(); popup.OnPopupSaved += async(s, arg) => { if (arg.Result) { var controller = new JsonController("setting"); var read = controller.Read(); if (read != null) { try { var dict = new Dictionary <string, object> { { "Grade", arg.Grade }, { "Class", arg.Class }, { "Number", arg.Number }, { "Name", arg.Name }, { "BirthMonth", arg.BirthMonth }, { "BirthDay", arg.BirthDay } }; controller.Add(dict); } catch (Exception ex) { await MainPage.GetInstance().ErrorAlert("설정", "설정을 완료하는 도중 오류가 발생했습니다.\n" + ex.Message); } } else { var jsonObj = new JObject( new JProperty("Grade", arg.Grade), new JProperty("Class", arg.Class), new JProperty("Number", arg.Number), new JProperty("Name", arg.Name), new JProperty("BirthMonth", arg.BirthMonth), new JProperty("BirthDay", arg.BirthDay)); await controller.Write(jsonObj); } App.Grade = arg.Grade; App.Class = arg.Class; App.Number = arg.Number; App.Name = arg.Name; App.BirthMonth = arg.BirthMonth; App.BirthDay = arg.BirthDay; TabbedHomePage.GetInstance().MyInfoUpdate(); MainPage.GetInstance().GetTimetable(); _ = TabbedSchedulePage.GetInstance().ViewScheduleAnimation(); DependencyService.Get <IToastMessage>().Longtime("입력된 정보가 저장되었습니다."); } }; await PopupNavigation.Instance.PushAsync(popup, App.Animation); task = false; } }