Exemplo n.º 1
0
        //Start Button
        //Check all Infomation..
        private void button1_Click(object sender, EventArgs e)
        {
            if (!File.Exists("SeparatorCore.dll"))
            {
                MessageBox.Show("Cannot find SeparatorCore.dll in current path!");
                return;
            }
            if (this.SelectFile && !string.IsNullOrEmpty(this.FileName))
            {
                StringBuilder sFileName = new StringBuilder(this.FileName);
                StringBuilder sArgs     = new StringBuilder(this.SPArgs);
                StringBuilder sPlugin   = new StringBuilder(this.PluginName);

                //this.Hide();
                //Wait
                this.Enabled = false;
                APIWarpper.SeparatorEntry(TaskInfo.FileTask, sFileName, sPlugin, sArgs, this.CPULogicCores);
                this.Enabled = true;
                //this.Show();
            }
            else if (this.SelectFolder && !string.IsNullOrEmpty(this.FolderName))
            {
                StringBuilder sFolderName = new StringBuilder(this.FolderName);
                StringBuilder sArgs       = new StringBuilder(this.SPArgs);
                StringBuilder sPlugin     = new StringBuilder(this.PluginName);

                APIWarpper.SeparatorEntry(TaskInfo.FolderTask, sFolderName, sPlugin, sArgs, this.CPULogicCores);
            }
            else if (this.SelectScript && !string.IsNullOrEmpty(this.ScriptName))
            {
                StringBuilder sScriptName = new StringBuilder(this.ScriptName);
                StringBuilder sArgs       = new StringBuilder(this.SPArgs);
                StringBuilder sPlugin     = new StringBuilder(this.PluginName);

                APIWarpper.SeparatorEntry(TaskInfo.ScriptTask, sScriptName, sPlugin, sArgs, this.CPULogicCores);
            }
            else
            {
                MessageBox.Show("Cannot launch task!");
                return;
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            bool  TestInfo = false;
            Mutex mutex    = new Mutex(true, "SeparatorOneInstanceModule", out TestInfo);

            if (!TestInfo)
            {
                MessageBox.Show("Separator is running!");
                System.Environment.Exit(-1);
            }
            if (!File.Exists("HighDPIPlugin.dll"))
            {
                MessageBox.Show("Cannot find HignDPIPlugin.dll");
                System.Environment.Exit(-1);
            }
            APIWarpper.DisableHighDPI();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            mutex.WaitOne();
        }