コード例 #1
0
ファイル: App.xaml.cs プロジェクト: testlinda/RMTV-recorder
        public static void Main()
        {
            CommonFunc.IntialUniqleString();

            if (SingleInstance <App> .InitializeAsFirstInstance(GlobalVar._uniqueStr))
            {
                var application = new App();
                application.InitializeComponent();
                application.Run();

                SingleInstance <App> .Cleanup();
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        private bool CheckKeyFileAvailable()
        {
            string keyFile = CommonFunc.GetKeyfilePath();

            if (!File.Exists(keyFile))
            {
                if (!CheckAuthentication())
                {
                    MessageBox.Show("Authentication failed!");
                    return(false);
                }
            }

            return(true);
        }
コード例 #4
0
        private bool LoadResource()
        {
            if (!CheckKeyFileAvailable())
            {
                return(false);
            }

            if (!CommonFunc.RunWithProcessingUC(
                    new OperationHandlerWithResult(CheckbinAvailable),
                    "Initialing..."))
            {
                return(false);
            }

            return(true);
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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();
                    }
                }
            }
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 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");
 }
コード例 #10
0
 private void btn_test_Click(object sender, RoutedEventArgs e)
 {
     CommonFunc.test();
 }
コード例 #11
0
 private void btn_updateM3U8_Click(object sender, RoutedEventArgs e)
 {
     CommonFunc.RunWithProcessingUC(new OperationHandlerWithResult(CommonFunc.DownloadM3U8), "Downloading fils...");
 }
コード例 #12
0
 private void UpdateClock()
 {
     label_timezone.Content = "UTC " + CommonFunc.GetTimeZoneHour(GlobalVar._timezoneId);
     grid_clock.ToolTip     = CommonFunc.GetTimeZoneDisplayName(GlobalVar._timezoneId);
 }
コード例 #13
0
        private void InitialCommonFunc()
        {
            CommonFunc func = new CommonFunc();

            func.window = this;
        }