Example #1
0
        private void SetStatus()
        {
            int nowHour = DateTime.Now.Hour;

            if (nowHour > 3 && nowHour <= 11) // Morning
            {
                this.Main.Background = new SolidColorBrush(Color.FromArgb(255, 130, 150, 190));
                this.IconBlock.Text  = char.ConvertFromUtf32(0xE2AD);
                this.MessBlock.Text  = UWPStates.GetUIString("GoodMorning");
            }
            else if (nowHour > 11 && nowHour <= 14)  // Noon
            {
                this.Main.Background = new SolidColorBrush(Color.FromArgb(255, 254, 183, 8));
                this.IconBlock.Text  = char.ConvertFromUtf32(0xE706);
                this.MessBlock.Text  = UWPStates.GetUIString("GoodNoon");
            }
            else if (nowHour > 14 && nowHour <= 18)  // Afternoon
            {
                this.Main.Background = new SolidColorBrush(Color.FromArgb(255, 202, 0, 62));
                this.IconBlock.Text  = char.ConvertFromUtf32(0xEC0A);
                this.MessBlock.Text  = UWPStates.GetUIString("GoodAfternoon");
            }
            else     // Night
            {
                this.Main.Background = new SolidColorBrush(Color.FromArgb(255, 178, 150, 123));
                this.IconBlock.Text  = char.ConvertFromUtf32(0xEC46);
                this.MessBlock.Text  = UWPStates.GetUIString("GoodNight");
            }
        }
Example #2
0
        private string ConvertToString(string value)
        {
            var nowHour = DateTime.Now.Hour;

            return(nowHour > 3 && nowHour <= 11 ? UWPStates.GetUIString("GoodMorning") :
                   nowHour > 11 && nowHour <= 14 ? UWPStates.GetUIString("GoodNoon") :
                   nowHour > 14 && nowHour < 18 ? UWPStates.GetUIString("GoodAfternoon") :
                   UWPStates.GetUIString("GoodNight"));
        }
Example #3
0
 private void SynchronizationContext_UnhandledException(object sender, Wallace.UWP.Helpers.Tools.UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     ReportHelper.ReportAttentionDebugAsync(UWPStates.GetUIString("Error") + " : \n" + e.Exception.Message, e.Exception.StackTrace);
 }
Example #4
0
 private void OnUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
 {
     e.Handled = true;
     ReportHelper.ReportAttentionDebugAsync(UWPStates.GetUIString("Error") + " : \n" + e.Exception.Message, e.Exception.StackTrace);
 }