protected override void OnCreate(Bundle bundle) { // If these are not used the ToString for DateTime throws an exception in some cultures // For more information: https://forums.xamarin.com/discussion/42899/datetime-tostring-throws-argumentoutofrangeexception-in-thai-locale var c1 = new System.Globalization.ChineseLunisolarCalendar(); var c2 = new System.Globalization.GregorianCalendar(); var c3 = new System.Globalization.HebrewCalendar(); var c4 = new System.Globalization.HijriCalendar(); var c5 = new System.Globalization.JapaneseCalendar(); var c6 = new System.Globalization.JapaneseLunisolarCalendar(); var c7 = new System.Globalization.JulianCalendar(); var c8 = new System.Globalization.KoreanCalendar(); var c9 = new System.Globalization.KoreanLunisolarCalendar(); var c10 = new System.Globalization.PersianCalendar(); var c11 = new System.Globalization.TaiwanCalendar(); var c12 = new System.Globalization.TaiwanLunisolarCalendar(); var c13 = new System.Globalization.ThaiBuddhistCalendar(); var c14 = new System.Globalization.UmAlQuraCalendar(); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.SetVmPolicy(builder.Build()); base.OnCreate(bundle); CrossCurrentActivity.Current.Init(this, bundle); PermissionsHelper.Activity = this; this.SetTheme(Resource.Style.Theme_Design_Light); //CachedImageRenderer.Init(false); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(false); global::Xamarin.Forms.Forms.Init(this, bundle); LoadApplication(new App()); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // If these are not used the ToString for DateTime throws an exception in some cultures // For more information: https://forums.xamarin.com/discussion/42899/datetime-tostring-throws-argumentoutofrangeexception-in-thai-locale var c1 = new System.Globalization.ChineseLunisolarCalendar(); var c2 = new System.Globalization.GregorianCalendar(); var c3 = new System.Globalization.HebrewCalendar(); var c4 = new System.Globalization.HijriCalendar(); var c5 = new System.Globalization.JapaneseCalendar(); var c6 = new System.Globalization.JapaneseLunisolarCalendar(); var c7 = new System.Globalization.JulianCalendar(); var c8 = new System.Globalization.KoreanCalendar(); var c9 = new System.Globalization.KoreanLunisolarCalendar(); var c10 = new System.Globalization.PersianCalendar(); var c11 = new System.Globalization.TaiwanCalendar(); var c12 = new System.Globalization.TaiwanLunisolarCalendar(); var c13 = new System.Globalization.ThaiBuddhistCalendar(); var c14 = new System.Globalization.UmAlQuraCalendar(); AnalyticsHelper.Initialize(Xamarin.Forms.Device.iOS); global::Xamarin.Forms.Forms.Init(); CachedImageRenderer.Init(); LoadApplication(new App()); UITextField.Appearance.TintColor = Xamarin.Forms.Color.FromHex("#2548D8").ToUIColor(); #if __TESTS__ Xamarin.Calabash.Start(); #endif return(base.FinishedLaunching(app, options)); }
private string getRokuyou(DateTime date) { var kyureki = new System.Globalization.JapaneseLunisolarCalendar(); int kyureki_m = kyureki.GetMonth(date); int kyureki_d = kyureki.GetDayOfMonth(date); // 閏月を取得 DateTime kyureki_ganjitu = kyureki.AddDays(date, 1 - kyureki.GetDayOfYear(date)); int uruu_m = kyureki.GetLeapMonth(kyureki.GetYear(kyureki_ganjitu), kyureki.GetEra(kyureki_ganjitu)); // 2017年であれば、閏月=6 が返る。6番目の月が閏月、すなわち「閏5月」となる。 // 閏月のない年では、閏月=0 が返る。 // 閏月がある場合の旧暦月の補正 if ((uruu_m > 0) && (kyureki_m >= uruu_m)) { kyureki_m--; } // 六曜を算出 return(((Utile.Data.六曜)((kyureki_m + kyureki_d) % 6)).ToString()); }