Пример #1
0
        private void menu_check(object sender, RoutedEventArgs e)
        {
            menuType tmp = (menuType)(int.Parse((sender as MenuItem).Tag.ToString()));
            //MessageBox.Show(tmp.ToString());
            Process myProcess;

            switch (tmp)
            {
            case menuType.MENU_CALIBRATION:
                EvoCalibrationWin wina = new EvoCalibrationWin(_my._MachineInfo);
                wina.Show();
                break;

            case menuType.MENU_IMPORT:
                Microsoft.Win32.OpenFileDialog op = new Microsoft.Win32.OpenFileDialog();
                op.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "outport";
                op.Filter           = "evos File|*.evos";
                op.FilterIndex      = 1;
                if ((bool)op.ShowDialog())
                {
                    string savePath = op.FileName;
                    if (MessageBox.Show("Overwrite the current config?", "Hint", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        FunctionFileManage.ImpportDB(savePath);
                    }
                }
                break;

            case menuType.MENU_EXPORT:
                Microsoft.Win32.SaveFileDialog openFileDialog = new Microsoft.Win32.SaveFileDialog();
                openFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory + "outport";
                openFileDialog.Filter           = "evos File|*.evos";
                openFileDialog.FilterIndex      = 1;

                if ((bool)openFileDialog.ShowDialog())
                {
                    string savePath = openFileDialog.FileName;
                    FunctionFileManage.ExportDB(savePath);
                }
                break;

            case menuType.MENU_COM:
                _my.ComCmd.Execute(513);
                break;

            case menuType.MENU_VISUAL:
                myProcess = new Process();
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName        = "GIFConverter.exe";
                    myProcess.StartInfo.CreateNoWindow  = true;
                    myProcess.Start();
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message);
                }
                break;

            case menuType.MENU_PIC:
                myProcess = new Process();
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName        = "EVO.TOOL.MAKEPIC.exe";
                    myProcess.StartInfo.CreateNoWindow  = true;
                    myProcess.Start();
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message);
                }
                break;

            case menuType.MENU_USB:
                myProcess = new Process();
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName        = "EVO.TOOL.USBFILE.exe";
                    myProcess.StartInfo.CreateNoWindow  = true;
                    myProcess.Start();
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message);
                }
                break;

            case menuType.MENU_HELP:
                MessageBox.Show("Coming Soon!!!");
                break;

            case menuType.MENU_ABOUT:
                MessageBox.Show("Version:" + MajorVersion.ToString() + "." + MinorVersion.ToString() + " supported by Crem", "Infomation");
                break;

            default:
                break;
            }
        }
Пример #2
0
        private void menu_check(object sender, RoutedEventArgs e)
        {
            menuType tmp = (menuType)(int.Parse((sender as MenuItem).Tag.ToString()));
            //MessageBox.Show(tmp.ToString());
            Process myProcess;

            switch (tmp)
            {
            case menuType.MENU_CALIBRATION:
                EvoCalibrationWin wina = new EvoCalibrationWin(_my._MachineInfo);
                wina.Show();
                break;

            case menuType.MENU_IMPORT:
                FunctionFileManage.ImpportDB("mydb.dbs");
                break;

            case menuType.MENU_EXPORT:
                FunctionFileManage.ExportDB("mydb.dbs");
                break;

            case menuType.MENU_COM:
                _my.ComCmd.Execute(513);
                break;

            case menuType.MENU_VISUAL:
                break;

            case menuType.MENU_PIC:
                myProcess = new Process();
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName        = "EVO.TOOL.MAKEPIC.exe";
                    myProcess.StartInfo.CreateNoWindow  = true;
                    myProcess.Start();
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message);
                }
                break;

            case menuType.MENU_USB:
                myProcess = new Process();
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    myProcess.StartInfo.FileName        = "EVO.TOOL.USBFILE.exe";
                    myProcess.StartInfo.CreateNoWindow  = true;
                    myProcess.Start();
                }
                catch (Exception e1)
                {
                    Console.WriteLine(e1.Message);
                }
                break;

            case menuType.MENU_HELP:
                MessageBox.Show("Coming Soon!!!");
                break;

            case menuType.MENU_ABOUT:
                MessageBox.Show("V1.00 supported by Crem", "Infomation");
                break;

            default:
                break;
            }
        }