コード例 #1
0
        public void ShowDiff(object repositoryId, long firstVersion, long lastVersion)
        {
            ThreadPool.QueueUserWorkItem(delegate(object args)
            {
                using (TemporaryDirectory tempDir1 = new TemporaryDirectory( ),
                       tempDir2 = new TemporaryDirectory( ))
                {
                    try
                    {
                        string firstFile  = DownloadFileVersion(repositoryId, firstVersion, tempDir1);
                        string secondFile = DownloadFileVersion(repositoryId, lastVersion, tempDir2);

                        Process viewer = ExternalToolsHelper.GetDiffProgram(
                            firstFile,
                            secondFile,
                            @"C:\program files\Microsoft Visual Studio 8\Common7\IDE\diffmerge.exe",
                            string.Format("{0} {1}", ExternalToolsHelper.Quote(firstFile), ExternalToolsHelper.Quote(secondFile)),
                            ExternalToolsSettings
                            );

                        viewer.Start( );

                        viewer.WaitForExit( );
                    }
                    catch (Exception e)
                    {
                        Trace.WriteLine(e);
                    }
                }
            });
        }
コード例 #2
0
        /// <summary>
        /// Opens the file, and waits for the viewing process to exit.
        /// </summary>
        /// <param name="path">The path of the file to open.</param>
        public static void View(string path, ExternalToolsSettings externalToolsSettings)
        {
            Process viewer = ExternalToolsHelper.GetViewerProgram(
                path,
                FileViewer,
                ExternalToolsHelper.Quote(path),
                externalToolsSettings);

            viewer.Start();

            viewer.WaitForExit();
        }