Esempio n. 1
0
        public ChgReserveWindow()
        {
            InitializeComponent();

            this.DataContext = this; // (nekopanda版)

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => DialogResult = false));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, button_chg_reserve_Click, (sender, e) => e.CanExecute    = addMode != AddMode.Change));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, button_chg_reserve_Click, (sender, e) => e.CanExecute = addMode == AddMode.Change));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, button_del_reserve_Click, (sender, e) => e.CanExecute = addMode == AddMode.Change));

            //ボタンの設定
            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_chg_reserve, EpgCmds.ChangeInDialog);
            mBinds.SetCommandToButton(button_del_reserve, EpgCmds.DeleteInDialog);
            mBinds.AddInputCommand(EpgCmds.AddInDialog);//ボタンの切り替え用も登録しておく。
            mBinds.ResetInputBindings(this);

            //その他設定
            //深夜時間関係は、comboBoxの表示だけ変更する手もあるが、
            //オプション変更タイミングなどいろいろ面倒なので、実際の値で処理することにする。
            comboBox_service.ItemsSource = ChSet5.ChList.Values;
            comboBox_sh.ItemsSource      = CommonManager.Instance.HourDictionarySelect.Values;
            comboBox_eh.ItemsSource      = CommonManager.Instance.HourDictionarySelect.Values;
            comboBox_sm.ItemsSource      = CommonManager.Instance.MinDictionary.Values;
            comboBox_em.ItemsSource      = CommonManager.Instance.MinDictionary.Values;
            comboBox_ss.ItemsSource      = CommonManager.Instance.MinDictionary.Values;
            comboBox_es.ItemsSource      = CommonManager.Instance.MinDictionary.Values;
        }
        public void SetData(Control ow, ListBox listbox, LVDMHelper helper, MenuBinds mbinds = null)
        {
            try
            {
                Owner   = ow;
                listBox = listbox;
                hlp     = helper;
                MenuBinds mBinds = mbinds ?? new MenuBinds();

                //マウスイベント関係
                this.listBox.PreviewMouseLeftButtonUp   += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonUp);
                this.listBox.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(listBox_PreviewMouseLeftButtonDown);
                ViewUtil.ResetItemContainerStyle(listbox);
                listbox.ItemContainerStyle.Setters.Add(new EventSetter(Mouse.MouseEnterEvent, new MouseEventHandler(listBoxItem_MouseEnter)));

                //移動などのアクションはBoxExchangeEditorのものをそのまま使用する。
                bx = new BoxExchangeEditor {
                    TargetBox = listBox
                };

                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.TopItem, (sender, e) => ItemsAction(() => bx.button_Top_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.UpItem, (sender, e) => ItemsAction(() => bx.button_Up_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DownItem, (sender, e) => ItemsAction(() => bx.button_Down_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.BottomItem, (sender, e) => ItemsAction(() => bx.button_Bottom_Click(null, null))));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.SaveOrder, SaveOrder_handler, (sender, e) => e.CanExecute = NotSaved == true));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.RestoreOrder, (sender, e) => hlp.RestoreOrder(), (sender, e) => e.CanExecute = NotSaved == true));
                this.Owner.CommandBindings.Add(new CommandBinding(EpgCmds.DragCancel, (sender, e) => DragRelease()));

                mBinds.SetCommandToButton(button_top, EpgCmds.TopItem);
                mBinds.SetCommandToButton(button_up, EpgCmds.UpItem);
                mBinds.SetCommandToButton(button_down, EpgCmds.DownItem);
                mBinds.SetCommandToButton(button_bottom, EpgCmds.BottomItem);
                mBinds.SetCommandToButton(button_saveItemOrder, EpgCmds.SaveOrder);
                mBinds.SetCommandToButton(button_reloadItem, EpgCmds.RestoreOrder);
                mBinds.AddInputCommand(EpgCmds.DragCancel);//アイテムのドラッグキャンセル
                if (mbinds == null)
                {
                    mBinds.ResetInputBindings(this.Owner, this.listBox);
                }

                //コマンドだと、DragCancelしない場合に、CanExecuteを割り当てても、Handled=falseにしても、
                //Keygestureが先へ伝搬してくれないので、対処療法的だけど先に処理してしまうことにする。コマンドの意味無い‥。
                listBox.PreviewKeyDown += new KeyEventHandler((sender, e) =>
                {
                    if (e.Handled == false && e.Key == Key.Escape && e.IsRepeat == false && _onDrag == true)
                    {
                        EpgCmds.DragCancel.Execute(null, this);
                        //this.listBox.Items.Refresh();//壊したバインディングを修復する。モタツキ感があるので放置する。
                        e.Handled = true;
                    }
                });
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Esempio n. 3
0
        public AddReserveEpgWindow()
        {
            InitializeComponent();

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => DialogResult = false));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, button_add_reserve_Click));

            //ボタンの設定
            var mBinds = new MenuBinds();
            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_add_reserve, EpgCmds.AddInDialog);

            //ショートカットの登録
            mBinds.ResetInputBindings(this);
        }
Esempio n. 4
0
        public AddReserveEpgWindow()
        {
            InitializeComponent();

            //コマンドの登録
            this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => DialogResult = false));
            this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, button_add_reserve_Click));

            //ボタンの設定
            var mBinds = new MenuBinds();

            mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
            mBinds.SetCommandToButton(button_add_reserve, EpgCmds.AddInDialog);

            //ショートカットの登録
            mBinds.ResetInputBindings(this);
        }
Esempio n. 5
0
        public AddManualAutoAddWindow()
        {
            InitializeComponent();

            try
            {
                //コマンドの登録
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Cancel, (sender, e) => DialogResult = false));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.AddInDialog, button_add_click));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.ChangeInDialog, button_chg_click, (sender, e) => e.CanExecute   = chgMode));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.DeleteInDialog, button_del_click, (sender, e) => e.CanExecute   = chgMode));
                this.CommandBindings.Add(new CommandBinding(EpgCmds.Delete2InDialog, button_del2_click, (sender, e) => e.CanExecute = chgMode));

                //ボタンの設定
                mBinds.SetCommandToButton(button_cancel, EpgCmds.Cancel);
                mBinds.SetCommandToButton(button_chg, EpgCmds.ChangeInDialog);
                mBinds.SetCommandToButton(button_add, EpgCmds.AddInDialog);
                mBinds.SetCommandToButton(button_del, EpgCmds.DeleteInDialog);
                mBinds.SetCommandToButton(button_del2, EpgCmds.Delete2InDialog);
                mBinds.ResetInputBindings(this);

                //その他設定
                comboBox_startHH.DataContext   = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_startHH.SelectedIndex = 0;
                comboBox_startMM.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_startMM.SelectedIndex = 0;
                comboBox_startSS.DataContext   = CommonManager.Instance.MinDictionary.Values;
                comboBox_startSS.SelectedIndex = 0;
                comboBox_endHH.DataContext     = CommonManager.Instance.HourDictionarySelect.Values;
                comboBox_endHH.SelectedIndex   = 0;
                comboBox_endMM.DataContext     = CommonManager.Instance.MinDictionary.Values;
                comboBox_endMM.SelectedIndex   = 0;
                comboBox_endSS.DataContext     = CommonManager.Instance.MinDictionary.Values;
                comboBox_endSS.SelectedIndex   = 0;

                comboBox_service.ItemsSource   = ChSet5.ChList.Values;
                comboBox_service.SelectedIndex = 0;

                recSettingView.SetViewMode(false);
                SetChangeMode(false);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
        }
Esempio n. 6
0
 public void RefreshMenu()
 {
     mBinds.ResetInputBindings(this, listView_result);
     mm.CtxmGenerateContextMenu(listView_result.ContextMenu, CtxmCode.SearchWindow, true);
 }
Esempio n. 7
0
 public virtual void RefreshMenu()
 {
     //設定されてなければ何もしない
     mBinds.ResetInputBindings(this, this);
 }