private void Button_Confirm_Click(object sender, RoutedEventArgs e) { temp_currenttime = CommonFunc.GetZoneTime(GlobalVar._timezoneId); temp_starttime = GetStartTime(); temp_endtime = GetEndTime(); if (CheckData()) { for (int i = 0; i < GetRepeatDays(); i++) { RecObj recObj = new RecObj { Channel = GetChannel(), ChannelLink = GetChannelLink(), StartTime = temp_starttime.AddDays(i), EndTime = temp_endtime, Duration = GetDuration(), TimeZoneId = GlobalVar._timezoneId, Status = RecObj.RecordStatus.Scheduled, Log = "", RetryTimes = 0, }; recObj.Initialization(); GlobalVar._RecObjs.Add(recObj); } base.OnCloseDialog(this, true, e); } }
private void btn_deleteRec_Click(object sender, RoutedEventArgs e) { if (dgRecObj.SelectedItems.Count > 0) { int count = dgRecObj.SelectedItems.Count; for (int i = 0; i < count; i++) { RecObj recObj = (RecObj)dgRecObj.SelectedItems[count - i - 1]; if (recObj.Status == RecObj.RecordStatus.Recording || recObj.Status == RecObj.RecordStatus.Stopping) { continue; } GlobalVar._RecObjs.Remove(recObj); } ; } if (GlobalVar._RecObjs.Count == 0) { chechbox_isshutdown.Visibility = Visibility.Hidden; StopRefreshDataGrid(); } }
public void Add(RecObj obj) { lock (SyncLock) { RecObjs.Add(obj); } }
private void AddRetryRecord() { if (RetryTimes >= Parameter.retry_times_limit) { return; } DateTime starttime = GetRetryStartTime(); if (IsNearTheEndTime(starttime)) { return; } RecObj recObj = new RecObj { Channel = Channel, ChannelLink = ChannelLink, StartTime = starttime, EndTime = EndTime, Duration = GetRetryDuration(starttime, EndTime), TimeZoneId = TimeZoneId, Status = RecObj.RecordStatus.WaitForRetry, Log = "", RetryTimes = this.RetryTimes + 1, }; recObj.Initialization(); GlobalVar._RecObjs.Add(recObj); }
private void btn_ctrlC_Click(object sender, RoutedEventArgs e) { if (dgRecObj.SelectedItems.Count > 0) { for (int i = 0; i < dgRecObj.SelectedItems.Count; i++) { RecObj recObj = (RecObj)dgRecObj.SelectedItems[i]; recObj.StopRecord(); } ; } }
public void Remove(RecObj obj) { lock (SyncLock) { if (obj.Status >= RecObj.RecordStatus.Completed) { InactiveCount--; } RecObjs.Remove(obj); obj.Dispose(); obj = null; } }
private void btn_openlog_s_Click(object sender, RoutedEventArgs e) { RecObj obj = ((FrameworkElement)sender).DataContext as RecObj; winCustom wincustom = new winCustom(); Log_UC log_uc = new Log_UC(); log_uc.Log = obj.GetLog(); log_uc.CloseDialog += new ucCustom.CloseDialogHandler(UserControl_CloseDialog); wincustom.winContent = log_uc; wincustom.Title = "Log"; wincustom.Topmost = true; wincustom.ShowInTaskbar = false; wincustom.ShowDialog(); }
private void btn_stopRec_Click(object sender, RoutedEventArgs e) { if (dgRecObj.SelectedItems.Count > 0) { for (int i = 0; i < dgRecObj.SelectedItems.Count; i++) { RecObj recObj = (RecObj)dgRecObj.SelectedItems[i]; if (recObj.Status == RecObj.RecordStatus.Recording) { recObj.StopRecord(); } } ; } }