GetInstance() public static method

Singleton
public static GetInstance ( ) : Handler
return Handler
Example #1
0
        public void ForceRefreshWindow()
        {
            //TODO: only force refresh today if the data is more than 5 minutes old

            //if (DatePicker.SelectedDate.HasValue && DatePicker.SelectedDate.Value.Date == DateTime.Now.Date)
            _currentPage = Handler.GetInstance().GetDashboardNavigateUriForType(DateTime.MinValue, _currentVisType); // to force refresh
            DatePickerSelectDate(DateTime.Now);
        }
Example #2
0
 private void SwitchToWeek_Clicked(object sender, RoutedEventArgs e)
 {
     _currentVisType = VisType.Week;
     SwitchToWeekButton.Visibility = Visibility.Collapsed;
     SwitchToDayButton.Visibility  = Visibility.Visible;
     TodayButton.Content           = "This Week";
     WebBrowserNavigateTo(Handler.GetInstance().GetDashboardNavigateUriForType(DatePicker.SelectedDate.Value, _currentVisType));
 }
Example #3
0
        private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            var      picker = sender as DatePicker;
            DateTime?date   = picker.SelectedDate;

            if (date != null && date.Value != null)
            {
                var selectedDate = date.Value;
                if (selectedDate > DateTime.Now)
                {
                    selectedDate = DateTime.Now;
                    DatePickerSelectDate(selectedDate);
                }

                //todo: check if dates are available before navigating
                WebBrowserNavigateTo(Handler.GetInstance().GetDashboardNavigateUriForType(date.Value, _currentVisType));
            }
        }
Example #4
0
        private void WindowLoaded(object sender, EventArgs e)
        {
            //var stream = OnStats();
            //todo: path issues: http://stackoverflow.com/questions/27661986/include-static-js-and-css-webbrowser-control
            //webBrowser.NavigateToString(stream);

#if !DEBUG
            webBrowser.ScriptErrorsSuppressed = true;
#endif

            webBrowser.Navigating += (o, ex) =>
            {
                ShowLoading(true);
            };

            webBrowser.Navigated += (o, ex) =>
            {
                ShowLoading(false);

#if DEBUG
                webBrowser.Document.Window.Error += (w, we) =>
                {
                    we.Handled = true;
                    Logger.WriteToConsole(string.Format(CultureInfo.InvariantCulture, "# URL: {1}, LN: {0}, ERROR: {2}", we.LineNumber, we.Url, we.Description));
                };
#endif
            };

            webBrowser.IsWebBrowserContextMenuEnabled = false;
            webBrowser.ObjectForScripting             = new ObjectForScriptingHelper(); // allows to use javascript to call functions in this class
            webBrowser.WebBrowserShortcutsEnabled     = false;
            webBrowser.AllowWebBrowserDrop            = false;


            // load default page
            WebBrowserNavigateTo(Handler.GetInstance().GetDashboardHome());
            SwitchToWeekButton.Visibility = Visibility.Visible;
            SwitchToDayButton.Visibility  = Visibility.Collapsed;
        }
        private void PrivacyStatement_Clicked(object sender, MouseButtonEventArgs e)

        {
            Handler.GetInstance().OpenPrivacyStatement();
        }
 private void Thomas_Clicked(object sender, MouseButtonEventArgs e)
 {
     Handler.GetInstance().SendFeedback();
 }
 private void Feedback_Clicked(object sender, RoutedEventArgs e)
 {
     Handler.GetInstance().SendFeedback();
 }
Example #8
0
 private void About_Clicked(object sender, RoutedEventArgs e)
 {
     Handler.GetInstance().OpenAbout();
 }
 public void JS_SendFeedback()
 {
     Handler.GetInstance().SendFeedback();
 }