private void dgvData_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            try
            {
                switch (dgvData.Columns[e.ColumnIndex].Name)
                {
                case "dgcContact":
                    string email = dgvData.Rows[e.RowIndex].Cells[e.ColumnIndex].Value as string;
                    if (!String.IsNullOrEmpty(email))
                    {
                        SimpleProcess.Start(String.Format("mailto:{0}", email));
                    }
                    break;

                default:
                    string url = dgvData.Rows[e.RowIndex].Cells["dgcUrl"].Value as string;
                    if (!String.IsNullOrEmpty(url))
                    {
                        SimpleProcess.Start(url);
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                SimpleMessage.ShowException(ex);
            }
        }
        public override PluginReturns Run(PluginArgument arg)
        {
            try
            {
                if (!SelectRootDirectory(arg.Host, false))
                {
                    if (SimpleMessage.Confirm("Failed to locate de4dot! Do you want to download now?") == System.Windows.Forms.DialogResult.Yes)
                    {
                        SimpleProcess.Start("https://bitbucket.org/0xd4d/de4dot/downloads");
                    }
                    return(PluginReturns.None);
                }

                var frm = new frmDe4dot(arg.Host, arg.Rows, arg.SourceDir);
                frm.ShowDialog();
                return(PluginReturns.Refresh);
            }
            catch
            {
                throw;
            }
            finally
            {
            }
        }
Exemplo n.º 3
0
 private void btnOpenLogFile_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(_logFile) && File.Exists(_logFile))
     {
         SimpleProcess.Start(_logFile);
     }
 }
Exemplo n.º 4
0
        private void Init(SimpleLoopTask loopTask)
        {
            var processInfos = GetProcessInfos("SimpleTrace.ini");

            foreach (var processInfo in processInfos)
            {
                //var jaegerInfo = SimpleProcessInfo.Create("jaeger-all-in-one", "jaeger-all-in-one.exe", "--collector.zipkin.http-port=9411");
                var process       = SimpleProcess.GetOrCreate(processInfo);
                var processRunner = new SimpleProcessRunner(process);
                LogInfo(string.Format("Init ProcessRunner: [{0}]", processInfo.ProcessName));
                Runners.Add(processRunner);
            }

            loopTask.LoopSpan   = TimeSpan.FromSeconds(15);
            loopTask.LoopAction = () =>
            {
                LogInfo("looping check trace service at " + DateHelper.Instance.GetDateNow().ToString("s"));
                foreach (var runner in Runners)
                {
                    runner.TryStart();
                }
            };

            loopTask.AfterExitLoopAction = () =>
            {
                LogInfo("stopping check trace service at " + DateHelper.Instance.GetDateNow().ToString("s"));
                foreach (var runner in Runners)
                {
                    runner.TryStop();
                }
            };
        }
Exemplo n.º 5
0
        public override PluginReturns Run(PluginArgument arg)
        {
            if (arg.Rows == null || arg.Rows.Length < 1)
            {
                SimpleMessage.ShowInfo("Please select file to open with Reflector.");
                return(PluginReturns.None);
            }

            try
            {
                if (!this.SelectReflector(arg.Host, false))
                {
                    if (SimpleMessage.Confirm("Failed to locate .Net Reflector! Do you want to download now?") == System.Windows.Forms.DialogResult.Yes)
                    {
                        SimpleProcess.Start("http://www.reflector.net/");
                    }
                    return(PluginReturns.None);
                }

                string path = GetReflector(arg.Host);

                try
                {
                    if (!RemoteController.Available)
                    {
                        Process p = new Process();
                        p.StartInfo.FileName         = path;
                        p.StartInfo.WorkingDirectory = Path.GetDirectoryName(path);
                        p.Start();
                    }

                    int count = 0;
                    while (!RemoteController.Available && count < 60)
                    {
                        Thread.Sleep(500);
                        count++;
                    }

                    if (RemoteController.Available)
                    {
                        for (int i = 0; i < arg.Rows.Length; i++)
                        {
                            RemoteController.LoadAssembly(Path.Combine(arg.SourceDir, arg.Rows[i]));
                        }
                    }
                }
                catch (Exception ex)
                {
                    SimpleMessage.ShowException(ex);
                }
            }
            catch
            {
                throw;
            }

            return(PluginReturns.None);
        }
Exemplo n.º 6
0
 private void btnReport_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(_reportUrl))
     {
         SimpleDotNet.SendEmail(GetSubject(), txtInfo.Text);
     }
     else
     {
         SimpleProcess.Start(_reportUrl);
     }
 }
Exemplo n.º 7
0
        public DotNetRunFixtureBase(string webAppRelativePath, string environment, string url, bool hideBrowser)
        {
            _webAppRelativePath = webAppRelativePath;
            _environment        = environment;
            _hideBrowser        = hideBrowser;
            _url = url;

            string filename = "dotnet.exe";
            string args     = $@"run --project {GetContentRootPath()}\ environment={_environment} --no-build --urls ""{_url}""";

            _process = new SimpleProcess(filename, args, _hideBrowser);
        }
Exemplo n.º 8
0
 private void lblLog_Click(object sender, EventArgs e)
 {
     if (_rows.Length == 1)
     {
         string outputFile = GetLogFileName(_rows[0]);
         if (File.Exists(outputFile))
         {
             SimpleProcess.Start(outputFile);
         }
     }
     else if (_rows.Length > 1)
     {
         string outputDir = _sourceDir;
         if (Directory.Exists(outputDir))
         {
             SimpleProcess.Start(outputDir);
         }
     }
 }
Exemplo n.º 9
0
        private void btnFindProcessWindows_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(txtProcess.Text))
            {
                return;
            }

            lstProcessWindows.Items.Clear();
            progressFind.Value = 0;

            var windows      = SimpleProcess.GetAllWindows(txtProcess.Text);
            int windowsCount = windows.Count();

            if (windowsCount == 0)
            {
                Size = new Size(MinimumSize.Width, MinimumSize.Height);  // resizing
                return;
            }

            progressFind.Step = 100 / windowsCount;

            var itemWidths = new List <int>();  // resizing

            foreach (var window in windows)
            {
                if (window.Handle != IntPtr.Zero && window.Visible)
                {
                    lstProcessWindows.Items.Add(window);
                }
                progressFind.PerformStep();

                itemWidths.Add((int)graphics.MeasureString(window.ToString(), Font).Width); // resizing
            }
            Size = new Size(itemWidths.Max() + 66, Height);                                 // resizing

            progressFind.Value = 100;
        }
Exemplo n.º 10
0
        public DaemonService()
        {
            InitializeComponent();

            //var clientProcess = SimpleProcess.GetOrCreate(new SimpleProcessInfo()
            //{
            //    ProcessName = "FooClient",
            //    ExePath = "FooClient.exe",
            //    ExeArgs = null
            //});


            var jaegerProcess = SimpleProcess.GetOrCreate(new SimpleProcessInfo()
            {
                ProcessName = "jaeger-all-in-one",
                ExePath     = "jaeger-all-in-one.exe",
                ExeArgs     = "--collector.zipkin.http-port=9411"
            });

            var runner = new SimpleProcessRunner(jaegerProcess);

            LoopTask = new SimpleLoopTask();
            Init(LoopTask, runner);
        }
Exemplo n.º 11
0
 private void mnuSDK35_Click(object sender, EventArgs e)
 {
     //SimpleProcess.OpenWebSite(@"http://www.microsoft.com/downloads/results.aspx?pocId=&freetext=.Net%20Framework%203.5%20SDK&DisplayLang=en");
     SimpleProcess.OpenWebSite(@"http://www.google.com.hk/#hl=en&q=windows+sdk+for+.net+framework+3.5+site:www.microsoft.com");
 }
 private void lblRandom_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", RandomFile.Default.FileName);
 }
 private void lblIgnoredTypeFile_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", IgnoredTypeFile.Default.FileName);
 }
 private void lblRemoveAttribute_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", AttributeFile.Default.FileName);
 }
 private void lblStringOption_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", IgnoredMethodFile.Default.FileName);
 }
 private void lblRemoveExceptionHandler_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", ExceptionHandlerFile.Default.FileName);
 }
 private void lblPatternFile_Click(object sender, EventArgs e)
 {
     SimpleProcess.Start("notepad.exe", PatternFile.Default.FileName);
 }
Exemplo n.º 18
0
 public static ValueTask <string> ExecuteGitVersionAsync(string?args = null) =>
 SimpleProcess.ReadAsync(GitVersionExecutableName, args);
Exemplo n.º 19
0
 private void mnuHome_Click(object sender, EventArgs e)
 {
     SimpleProcess.OpenWebSite(HomeUrl);
 }
Exemplo n.º 20
0
 public static void RunSimpleProcess(string name, string args, bool echoCommand = false) =>
 SimpleProcess.Run(name, args, echoCommand: echoCommand, outputReceived: Console.WriteLine, errorReceived: Console.Error.WriteLine);
Exemplo n.º 21
0
 private void mnuSDK4_Click(object sender, EventArgs e)
 {
     SimpleProcess.OpenWebSite(@"http://www.google.com.hk/#hl=en&q=microsoft+windows+SDK+for+windows+7+and+.net+framework+4.0+site:www.microsoft.com");
 }
Exemplo n.º 22
0
 public static string ExecuteGitVersion(string?args = null) =>
 SimpleProcess.Read(GitVersionExecutableName, args);
Exemplo n.º 23
0
 private void mnuSDK45_Click(object sender, EventArgs e)
 {
     SimpleProcess.OpenWebSite(@"http://msdn.microsoft.com/en-US/windows/hardware/hh852363");
 }