Ejemplo n.º 1
0
        private static void readparam()
        {
            string command = Environment.CommandLine;

            string[] para = command.Split('\"');
            if (para.Length > 3)
            {
                string pathC = para[3];
                if (pathC.EndsWith("evos"))
                {
                    string folder = para[1].Substring(0, para[1].LastIndexOf('\\'));
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(folder + "\\config");
                    if (di.GetFiles().Length > 0)
                    {
                        if (MessageBox.Show("Overwrite the current config?", "Hint", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                        {
                            FunctionFileManage.ImpportDB(pathC, folder + "\\config\\");
                        }
                        else
                        {
                        }
                    }
                }
            }
        }
Ejemplo n.º 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:
                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;
            }
        }
Ejemplo n.º 3
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;
            }
        }