public static void Main() { CommonFunc.IntialUniqleString(); if (SingleInstance <App> .InitializeAsFirstInstance(GlobalVar._uniqueStr)) { var application = new App(); application.InitializeComponent(); application.Run(); SingleInstance <App> .Cleanup(); } }
private void page_PreviewMouseDown(object sender, MouseButtonEventArgs e) { click_count++; if (click_count == Parameter.debug_on_click) { GlobalVar._debugmode = !GlobalVar._debugmode; RefreshDebugInfoVisibility(); CommonFunc.ToastMessage(label_message, String.Format("Debug mode is {0}!", GlobalVar._debugmode ? "ON" : "OFF"), 2); click_count = 0; } }
private bool CheckKeyFileAvailable() { string keyFile = CommonFunc.GetKeyfilePath(); if (!File.Exists(keyFile)) { if (!CheckAuthentication()) { MessageBox.Show("Authentication failed!"); return(false); } } return(true); }
private bool LoadResource() { if (!CheckKeyFileAvailable()) { return(false); } if (!CommonFunc.RunWithProcessingUC( new OperationHandlerWithResult(CheckbinAvailable), "Initialing...")) { return(false); } return(true); }
private void AutoFillInDatePicker() { DateTime currenttime = CommonFunc.GetZoneTime(GlobalVar._timezoneId); DateTime date = CommonFunc.SetZoneTime(GlobalVar._timezoneId, currenttime.Date, Convert.ToInt32(tb_starttime_hour.Text), Convert.ToInt32(tb_starttime_min.Text)); if (IsPreviousTime(date, currenttime)) { datepicker_startdate.SelectedDate = date.AddDays(1).Date; } else { datepicker_startdate.SelectedDate = date.Date; } }
private DateTime GetStartTime() { DateTime date; if (rb_starttime_now.IsChecked == true) { date = temp_currenttime.AddSeconds(Parameter.delay_sec); } else { date = CommonFunc.SetZoneTime(GlobalVar._timezoneId, datepicker_startdate.SelectedDate.Value.Date, Convert.ToInt32(tb_starttime_hour.Text), Convert.ToInt32(tb_starttime_min.Text)); } return(date); }
private void RefreshDataGrid() { //Debug.WriteLine("Refresh DataGrid at " + DateTime.Now.ToString("HH:mm:ss")); if (CommonFunc.GetStatusChangedFlag()) { CommonFunc.ClearStatusChangedFlag(); if (chechbox_isshutdown.IsChecked == true && chechbox_isshutdown.Visibility == Visibility.Visible && IsAllSceduleCompleted()) { StopRefreshDataGrid(); if (!CommonFunc.PrepareShutDown(this)) { chechbox_isshutdown.IsChecked = false; StartRefreshDataGrid(); } } } }
private DateTime GetEndTime() { DateTime date; if (rb_set_endtime.IsChecked == true) { date = CommonFunc.SetZoneTime(GlobalVar._timezoneId, datepicker_startdate.SelectedDate.Value.Date, Convert.ToInt32(tb_endtime_hour.Text), Convert.ToInt32(tb_endtime_min.Text)); if (IsPreviousTime(date, temp_starttime)) { date = date.AddDays(1); } } else { date = temp_starttime.AddSeconds(CalculateDuration2sec()); } return(date); }
private void InitailEndTime() { tb_endtime_hour.Text = CommonFunc.GetZoneTime(GlobalVar._timezoneId).AddHours(1).Hour.ToString("00"); tb_endtime_min.Text = CommonFunc.GetZoneTime(GlobalVar._timezoneId).Minute.ToString("00"); }
private void btn_test_Click(object sender, RoutedEventArgs e) { CommonFunc.test(); }
private void btn_updateM3U8_Click(object sender, RoutedEventArgs e) { CommonFunc.RunWithProcessingUC(new OperationHandlerWithResult(CommonFunc.DownloadM3U8), "Downloading fils..."); }
private void UpdateClock() { label_timezone.Content = "UTC " + CommonFunc.GetTimeZoneHour(GlobalVar._timezoneId); grid_clock.ToolTip = CommonFunc.GetTimeZoneDisplayName(GlobalVar._timezoneId); }
private void InitialCommonFunc() { CommonFunc func = new CommonFunc(); func.window = this; }