예제 #1
0
 private static void Start()
 {
     if (StartMode == Screens.StartMode.Capture)
     {
         Clipper.Clip(new Processor());
     }
     else if (StartMode == Screens.StartMode.Tray)
     {
         Tray.Run();
     }
     else
     {
         throw new NotImplementedException();
     }
 }
예제 #2
0
        public static void TakeSnapshot()
        {
            var psi = new System.Diagnostics.ProcessStartInfo(Application.ExecutablePath)
            {
                RedirectStandardOutput = true,
                UseShellExecute        = false
            };
            var p = System.Diagnostics.Process.Start(psi);

            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.UseShellExecute        = false;
            var resultsBuilder = new StringBuilder();

            while (!p.HasExited)
            {
                resultsBuilder.Append(p.StandardOutput.ReadToEnd());
            }
            Tray.ProcessReponse(resultsBuilder.ToString());
        }