本文整理汇总了C#中EpgTimer.ReserveData类的典型用法代码示例。如果您正苦于以下问题:C# ReserveData类的具体用法?C# ReserveData怎么用?C# ReserveData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReserveData类属于EpgTimer命名空间,在下文中一共展示了ReserveData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertEpgToReserveData
public static ReserveData ConvertEpgToReserveData(EpgEventInfo epgInfo)
{
if (epgInfo == null) return null;
ReserveData resInfo = new ReserveData();
epgInfo.ConvertToReserveData(ref resInfo);
return resInfo;
}
示例2: ConvertToReserveData
public static bool ConvertToReserveData(this EpgEventInfo epgInfo, ref ReserveData resInfo)
{
if (epgInfo == null || resInfo == null) return false;
resInfo.Title = epgInfo.Title();
resInfo.StartTime = epgInfo.start_time;
resInfo.StartTimeEpg = epgInfo.start_time;
resInfo.DurationSecond = (epgInfo.DurationFlag == 0 ? 10 * 60 : epgInfo.durationSec);
UInt64 key = epgInfo.Create64Key();
if (ChSet5.Instance.ChList.ContainsKey(key) == true)
{
resInfo.StationName = ChSet5.Instance.ChList[key].ServiceName;
}
resInfo.OriginalNetworkID = epgInfo.original_network_id;
resInfo.TransportStreamID = epgInfo.transport_stream_id;
resInfo.ServiceID = epgInfo.service_id;
resInfo.EventID = epgInfo.event_id;
return true;
}
示例3: ChangeReserve
private void ChangeReserve(ReserveData reserveInfo)
{
try
{
ChgReserveWindow dlg = new ChgReserveWindow();
dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual;
dlg.SetReserveInfo(reserveInfo);
if (dlg.ShowDialog() == true)
{
CommonManager.Instance.DB.SetUpdateNotify((UInt32)UpdateNotifyItem.ReserveInfo);
CommonManager.Instance.DB.ReloadReserveInfo();
SearchPg();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例4: ChangeReserve
/// <summary>
/// 予約変更
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ChangeReserve(ReserveData reserveInfo)
{
try
{
ChgReserveWindow dlg = new ChgReserveWindow();
dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual;
dlg.SetReserveInfo(reserveInfo);
if (dlg.ShowDialog() == true)
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例5: tunerReserveView_LeftDoubleClick
/// <summary>
/// 左ボタンダブルクリックイベント呼び出し
/// </summary>
/// <param name="sender"></param>
/// <param name="cursorPos"></param>
void tunerReserveView_LeftDoubleClick(object sender, Point cursorPos)
{
try
{
//まず予約情報あるかチェック
ReserveData reserve = new ReserveData();
if (GetReserveItem(cursorPos, ref reserve) == true)
{
//予約変更ダイアログ表示
ChangeReserve(reserve);
return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例6: cm_timeShiftPlay_Click
/// <summary>
/// 右クリックメニュー 追っかけ再生イベント呼び出し
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cm_timeShiftPlay_Click(object sender, RoutedEventArgs e)
{
try
{
if (sender.GetType() != typeof(MenuItem))
{
return;
}
ReserveData reserve = new ReserveData();
if (GetReserveItem(clickPos, ref reserve) == false)
{
return;
}
CommonManager.Instance.TVTestCtrl.StartTimeShift(reserve.ReserveID);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例7: cm_chg_recmode_Click
/// <summary>
/// 右クリックメニュー 予約モード変更イベント呼び出し
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cm_chg_recmode_Click(object sender, RoutedEventArgs e)
{
try
{
if (sender.GetType() != typeof(MenuItem))
{
return;
}
ReserveData reserve = new ReserveData();
if (GetReserveItem(clickPos, ref reserve) == false)
{
return;
}
MenuItem item = sender as MenuItem;
Int32 val = (Int32)item.DataContext;
reserve.RecSetting.RecMode = (byte)val;
List<ReserveData> list = new List<ReserveData>();
list.Add(reserve);
ErrCode err = (ErrCode)cmd.SendChgReserve(list);
if (err == ErrCode.CMD_ERR_CONNECT)
{
MessageBox.Show("サーバー または EpgTimerSrv に接続できませんでした。");
}
if (err == ErrCode.CMD_ERR_TIMEOUT)
{
MessageBox.Show("EpgTimerSrvとの接続にタイムアウトしました。");
}
if (err != ErrCode.CMD_SUCCESS)
{
MessageBox.Show("予約変更でエラーが発生しました。");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例8: cm_autoadd_Click
/// <summary>
/// 右クリックメニュー 自動予約登録イベント呼び出し
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void cm_autoadd_Click(object sender, RoutedEventArgs e)
{
try
{
if (sender.GetType() != typeof(MenuItem))
{
return;
}
ReserveData reserve = new ReserveData();
if (GetReserveItem(clickPos, ref reserve) == false)
{
return;
}
SearchWindow dlg = new SearchWindow();
dlg.Owner = (Window)PresentationSource.FromVisual(this).RootVisual;
dlg.SetViewMode(1);
EpgSearchKeyInfo key = new EpgSearchKeyInfo();
if (reserve.Title != null)
{
key.andKey = reserve.Title;
}
Int64 sidKey = ((Int64)reserve.OriginalNetworkID) << 32 | ((Int64)reserve.TransportStreamID) << 16 | ((Int64)reserve.ServiceID);
key.serviceList.Add(sidKey);
dlg.SetSearchDefKey(key);
dlg.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例9: ReserveItem
public ReserveItem(ReserveData item)
{
base.ReserveInfo = item;
}
示例10: Window_Loaded
private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (addMode == AddMode.Add || reserveInfo == null)
{
addMode = AddMode.Add;
reserveInfo = null;
ReserveMode = UIReserveMode.Program;
CanSelectAutoAdd = false;
if (comboBox_service.Items.Count > 0)
{
comboBox_service.SelectedIndex = 0;
}
SetAddMode(AddMode.Add);
SetReserveTime(DateTime.Now.AddMinutes(1), DateTime.Now.AddMinutes(31));
reserveInfo = new ReserveData();
}
else
{
ReserveMode = GetReserveModeFromInfo();
CanSelectAutoAdd = (ReserveMode == UIReserveMode.EPGAuto);
SetReserveTimeInfo(reserveInfo);
}
ResetProgramContent(); //番組詳細を初期表示
tabControl.SelectedIndex = openMode;
initialized = true;
}
示例11: tabControl_SelectionChanged
private void tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (tabControl.SelectedIndex == TabSelectedIndex) return;
TabSelectedIndex = tabControl.SelectedIndex;
if (tabItem_program.IsSelected)
{
if (ReserveMode == UIReserveMode.Program)
{
var resInfo = new ReserveData();
GetReserveTimeInfo(ref resInfo);
//描画回数の削減を気にしないなら、この条件文は無くてもいい
if (CtrlCmdDefEx.EqualsPg(resInfoDisplay, resInfo, false, true) == false)
{
//EPGを自動で読み込んでない時でも、元がEPG予約ならその番組情報は表示させられるようにする
if (reserveInfo.EventID != 0xFFFF && CtrlCmdDefEx.EqualsPg(reserveInfo, resInfo, false, true) == true)
{
SetProgramContent(reserveInfo.SearchEventInfo(true));
}
else
{
SetProgramContent(resInfo.SearchEventInfoLikeThat());
}
resInfoDisplay = resInfo;
}
}
else
{
//EPG予約を変更していない場合引っかかる。
//最も表示される可能性が高いので、何度も探しにいかせないようにする。
if (eventInfoSelected == null)
{
eventInfoSelected = reserveInfo.SearchEventInfo(true);
}
SetProgramContent(eventInfoSelected);
resInfoDisplay = null;
}
}
}
示例12: SetReserveTimeInfo
private void SetReserveTimeInfo(ReserveData resInfo)
{
if (resInfo == null) return;
try
{
textBox_title.Text = resInfo.Title;
foreach (ChSet5Item ch in comboBox_service.Items)
{
if (ch.Key == resInfo.Create64Key())
{
comboBox_service.SelectedItem = ch;
break;
}
}
SetReserveTime(resInfo.StartTime,resInfo.StartTime.AddSeconds(resInfo.DurationSecond));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
}
示例13: ReserveModeChanged
private void ReserveModeChanged()
{
// UIに反映させる
SetResModeProgram();
if (!initialized) return;
if (ReserveMode == UIReserveMode.Program)
{
eventInfoNew = null;
}
else if (ReserveMode == UIReserveMode.EPGManual)
{
var resInfo = new ReserveData();
GetReserveTimeInfo(ref resInfo);
if (reserveInfo.EventID != 0xFFFF && CtrlCmdDefEx.EqualsPg(reserveInfo, resInfo, false, true) == true)
{
//EPG予約で、元の状態に戻る場合
textBox_title.Text = reserveInfo.Title;
eventInfoNew = null;
}
else
{
eventInfoNew = resInfo.SearchEventInfoLikeThat();
if (eventInfoNew == null)
{
MessageBox.Show("変更可能な番組がありません。\r\n" +
"EPGの期間外か、EPGデータが読み込まれていません。");
ReserveMode = UIReserveMode.Program;
}
else
{
SetReserveTimeInfo(CtrlCmdDefEx.ConvertEpgToReserveData(eventInfoNew));
}
}
}
else if (ReserveMode == UIReserveMode.EPGAuto)
{
SetReserveTimeInfo(reserveInfo);
}
eventInfoSelected = eventInfoNew;
}
示例14: GetReserveTimeInfo
private int GetReserveTimeInfo(ref ReserveData resInfo)
{
if (resInfo == null) return -1;
try
{
resInfo.Title = textBox_title.Text;
ChSet5Item ch = comboBox_service.SelectedItem as ChSet5Item;
resInfo.StationName = ch.ServiceName;
resInfo.OriginalNetworkID = ch.ONID;
resInfo.TransportStreamID = ch.TSID;
resInfo.ServiceID = ch.SID;
//resInfo.EventID = 0xFFFF; 条件付の情報なのでここでは書き換えないことにする
resInfo.StartTime = new DateTime(datePicker_start.SelectedDate.Value.Year,
datePicker_start.SelectedDate.Value.Month,
datePicker_start.SelectedDate.Value.Day,
comboBox_sh.SelectedIndex,
comboBox_sm.SelectedIndex,
comboBox_ss.SelectedIndex,
0,
DateTimeKind.Utc
);
DateTime endTime = new DateTime(datePicker_end.SelectedDate.Value.Year,
datePicker_end.SelectedDate.Value.Month,
datePicker_end.SelectedDate.Value.Day,
comboBox_eh.SelectedIndex,
comboBox_em.SelectedIndex,
comboBox_es.SelectedIndex,
0,
DateTimeKind.Utc
);
if (resInfo.StartTime > endTime)
{
resInfo.DurationSecond = 0;
return -2;
}
else
{
TimeSpan duration = endTime - resInfo.StartTime;
resInfo.DurationSecond = (uint)duration.TotalSeconds;
return 0;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
return -1;
}
示例15: button_chg_reserve_Click
private void button_chg_reserve_Click(object sender, ExecutedRoutedEventArgs e)
{
try
{
if (CmdExeUtil.IsDisplayKgMessage(e) == true)
{
bool change_proc = false;
switch (addMode)
{
case AddMode.Add:
change_proc = (MessageBox.Show("予約を追加します。\r\nよろしいですか?", "予約の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK);
break;
case AddMode.Re_Add:
change_proc = (MessageBox.Show("この内容で再予約します。\r\nよろしいですか?", "再予約の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK);
break;
case AddMode.Change:
change_proc = (MessageBox.Show("この予約を変更します。\r\nよろしいですか?", "変更の確認", MessageBoxButton.OKCancel) == MessageBoxResult.OK);
break;
}
if (change_proc == false) return;
}
if (addMode == AddMode.Change && CheckExistReserveItem() == false) return;
//ダイアログを閉じないときはreserveInfoを変更しないよう注意する
if (ReserveMode == UIReserveMode.Program)
{
var resInfo = new ReserveData();
if (GetReserveTimeInfo(ref resInfo) == -2)
{
MessageBox.Show("終了日時が開始日時より前です");
return;
}
//reserveInfo取得前に保存する。サービスや時間が変わったら、個別予約扱いにする。タイトルのみ変更は見ない。
bool chgManualMode = !CtrlCmdDefEx.EqualsPg(resInfo, reserveInfo, false, true);
GetReserveTimeInfo(ref reserveInfo);
if (reserveInfo.EventID != 0xFFFF || chgManualMode == true)
{
reserveInfo.EventID = 0xFFFF;
reserveInfo.Comment = "";
}
reserveInfo.StartTimeEpg = reserveInfo.StartTime;
}
else if(ReserveMode == UIReserveMode.EPGManual)
{
//EPG予約に変える場合、またはEPG予約で別の番組に変わる場合
if (eventInfoNew != null)
{
//基本的にAddReserveEpgWindowと同じ処理内容
if (mutil.IsEnableReserveAdd(eventInfoNew) == false) return;
eventInfoNew.ConvertToReserveData(ref reserveInfo);
reserveInfo.Comment = "";
}
// 自動予約から個別予約に変える場合
else if(GetReserveModeFromInfo() == UIReserveMode.EPGAuto)
{
reserveInfo.Comment = "";
}
}
reserveInfo.RecSetting = recSettingView.GetRecSetting();
if (addMode == AddMode.Change)
{
mutil.ReserveChange(CommonUtil.ToList(reserveInfo));
}
else
{
mutil.ReserveAdd(CommonUtil.ToList(reserveInfo));
}
// EPG自動予約以外になったら戻せないようにしておく
if(ReserveMode != UIReserveMode.EPGAuto)
{
CanSelectAutoAdd = false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
}
DialogResult = true;
}