Ejemplo n.º 1
0
 public void toolStripMenuItem_Reboot_Click(object sender, EventArgs e)
 {
     OpeInfoTable.GetInstance().UnregisterAllOpeToHotKey(Window.GetHWnd());
     //OpeScript.GetInstance().CloseLua();
     System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
     Application.Current.Shutdown();
 }
Ejemplo n.º 2
0
        public MainSettingWindow()
        {
            InitializeComponent();


            dgOpeList.DataContext = OpeInfoTable.GetInstance();

            _LLKeyboardProc = new KeyboardHook.LowLevelKeyboardProc(LLKeyboardProc);
            hHandle         = KeyboardHook.SetHook(_LLKeyboardProc);
        }
Ejemplo n.º 3
0
        private void CloseWithOK()
        {
            UnregisterHotkeys();

            OpeInfoTable.GetInstance().Save();

            OpeScript.GetInstance().Initialize();

            MyHide();
        }
Ejemplo n.º 4
0
        private void btnEditScript_Click(object sender, RoutedEventArgs e)
        {
            DataGridRow curt_row = VisualTreeUtil.FindParent <DataGridRow>(sender as DependencyObject);

            int idx = int.Parse((dgOpeList.Columns[0].GetCellContent(curt_row) as TextBlock).Text);

            ScriptSettingWindow script_setting_window
                = new ScriptSettingWindow(OpeInfoTable.GetInstance().GetRowById(idx));

            script_setting_window.Owner = this;
            script_setting_window.ShowDialog();
        }
Ejemplo n.º 5
0
        private void CloseWithCancel()
        {
            UnregisterHotkeys();

            OpeInfoTable.GetInstance().RollBackBeforeEditing();

            // Update reference.
            dgOpeList.DataContext = OpeInfoTable.GetInstance();
            dgOpeList.Items.Refresh();

            OpeScript.GetInstance().Initialize();

            MyHide();
        }
Ejemplo n.º 6
0
        private void StopSimulation()
        {
            grdDebugSet.Visibility = Visibility.Hidden;
            GridLengthConverter gridLengthConverter = new GridLengthConverter();

            RDefSim.Height = (GridLength)gridLengthConverter.ConvertFrom("0");
            MakeEnableDgOpeList();

            OpeScript.GetInstance().Initialize();

            OpeInfoTable.GetInstance().UnregisterAllOpeToHotKey(GetHWnd());

            btnSimulation.IsChecked = false;
        }
Ejemplo n.º 7
0
        private void StartSimulation()
        {
            MakeDisenableDgOpeList();
            RowDefinition       row_def             = new RowDefinition();
            GridLengthConverter gridLengthConverter = new GridLengthConverter();

            RDefSim.Height         = (GridLength)gridLengthConverter.ConvertFrom("1*");
            grdDebugSet.Visibility = Visibility.Visible;

            OpeScript.GetInstance().Initialize(TbxOutput);

            OpeInfoTable.GetInstance().RegisterAllOpeToHotKey(GetHWnd());

            btnSimulation.IsChecked = true;
        }
Ejemplo n.º 8
0
        public static int GetNextHighestPriority()
        {
            int max_priority = 0;

            foreach (DataRow r in OpeInfoTable.GetInstance().Rows)
            {
                if (r["HotKeyObject"] is ComboKey)
                {
                    int tmp = ((ComboKey)r["HotKeyObject"]).Priority;

                    if (tmp > max_priority)
                    {
                        max_priority = tmp;
                    }
                }
            }

            return(max_priority + 1);
        }
Ejemplo n.º 9
0
        private void ThreadPreprocessMessageMethod(ref MSG msg, ref bool handled)
        {
            const int WM_HOTKEY = 0x0312;

            switch (msg.message)
            {
            case WM_HOTKEY:
                int id = msg.wParam.ToInt32();
                int combo_id;
                if (ComboKey.FindComboToFire(id, out combo_id))
                {
                    OpeInfoTable.GetInstance().DoOpeScript(combo_id);
                }
                else
                {
                    OpeInfoTable.GetInstance().DoOpeScript(id);
                }
                handled = true;
                break;
            }
        }
Ejemplo n.º 10
0
 private void OpenSetting()
 {
     OpeInfoTable.GetInstance().UnregisterAllOpeToHotKey(Window.GetHWnd());
     Window.MyShow();
 }
Ejemplo n.º 11
0
 public void toolStripMenuItem_Exit_Click(object sender, EventArgs e)
 {
     OpeInfoTable.GetInstance().UnregisterAllOpeToHotKey(Window.GetHWnd());
     //OpeScript.GetInstance().CloseLua();
     Application.Current.Shutdown();
 }
Ejemplo n.º 12
0
 private void UnregisterHotkeys()
 {
     OpeInfoTable.GetInstance().UnregisterAllOpeToHotKey(GetHWnd());
 }
Ejemplo n.º 13
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     OpeInfoTable.GetInstance().AddRowAsDefault();
 }