Esempio n. 1
0
        private static void CompareLastDirectory(string tipo)
        {
            string dirAppData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DiffDotNet");

            if (!File.Exists(Path.Combine(dirAppData, "DiffDotNet.exe")))
            {
                Directory.CreateDirectory(dirAppData);
                File.WriteAllBytes(Path.Combine(dirAppData, "MeneesDiffUtils.dll"), Comparer.MeneesDiffUtils);
                File.WriteAllBytes(Path.Combine(dirAppData, "Menees.dll"), Comparer.Menees);
                File.WriteAllBytes(Path.Combine(dirAppData, "DiffDotNet.exe"), Comparer.DiffDotNet);
            }

            // Start the child process.
            Process p = new Process();

            p.StartInfo.UseShellExecute = false;

            p.StartInfo.FileName = Path.Combine(dirAppData, "DiffDotNet.exe");

            //Saco directorio donde se guardan las comparaciones.
            IKBService kbserv = UIServices.KB;
            string     dir    = "";

            if (tipo == "NVG")
            {
                dir = KBDoctorHelper.NvgComparerDirectory(kbserv);
            }
            if (tipo == "OBJ")
            {
                dir = KBDoctorHelper.ObjComparerDirectory(kbserv);
            }

            //Me quedo con los ultimos dos directorios
            string d1 = "";
            string d2 = "";

            foreach (string d in Directory.GetDirectories(dir, "*", SearchOption.TopDirectoryOnly))
            {
                d2 = d1;
                d1 = d;
            }
            if (d2 == "" || d1 == "")
            {
                string         title  = "KBDoctor - Compare files";
                IOutputService output = CommonServices.Output;
                output.StartSection(title);
                output.AddErrorLine("There isn't two directory to compare in " + dir + ". You must generate files first and then compare ");
                output.EndSection(title, true);
            }
            else
            {
                p.StartInfo.Arguments = d2 + " " + d1;
                p.Start();
            }
        }
Esempio n. 2
0
 public static void OpenFolderObjComparerNavigation()
 {
     Process.Start(KBDoctorHelper.ObjComparerDirectory(UIServices.KB));
 }