public override void Run(string[] args, MessageBoxErrorReporter reporter)
        {
            var parsedArguments = new Arguments();

            reporter.CommandUsage = Parser.ArgumentsUsage(parsedArguments.GetType());

            if (Parser.ParseArguments(args, parsedArguments, reporter.Handler))
            {
                var filterFile = FilterFile.FromFile(parsedArguments.FilterFile);

                // Save the filtered solution. We also add a link to the original solution file in the filtered solution.
                // If we have to checkout the original solution file later on, its easier with that link.
                var filteredSolution = filterFile.Apply();

                // Add OriginalSolutionFile to the filter solution (and a warnings file if needed)
                filteredSolution.Projects.Add(CreateOriginalSolutionProject(filterFile.SourceSolution));

                filteredSolution.Save();
                if (filterFile.CopyReSharperFiles)
                {
                    var resharperGlobalFileSettingsSource = filterFile.SourceSolutionFullPath + ".DotSettings";
                    if (File.Exists(resharperGlobalFileSettingsSource))
                    {
                        File.Copy(resharperGlobalFileSettingsSource, filteredSolution.SolutionFullPath + ".DotSettings", true);
                    }

                    var resharperUserFileSettingsSource      = filterFile.SourceSolutionFullPath + ".DotSettings.user";
                    var resharperUserFileSettingsDestination = filteredSolution.SolutionFullPath + ".DotSettings.user";
                    if (File.Exists(resharperUserFileSettingsSource) && !File.Exists(resharperUserFileSettingsDestination))
                    {
                        File.Copy(resharperUserFileSettingsSource, resharperUserFileSettingsDestination);
                    }
                }

                if (!parsedArguments.CreateOnly)
                {
                    filterFile.StartFilteredSolutionWatcher(
                        filteredSolution,
                        delegate(NodeDifference difference)
                    {
                        using (var fix = new TopMostFormFix())
                        {
                            using (var form = new UpdateOriginalSolutionForm(difference, filterFile.SourceSolutionFullPath))
                            {
                                return(form.ShowDialog() == DialogResult.Yes);
                            }
                        }
                    });

                    var startTime = DateTime.Now;
                    var process   = Process.Start(filteredSolution.SolutionFullPath);

                    if (parsedArguments.Wait || filterFile.WatchForChangesOnFilteredSolution)
                    {
                        process.WaitForExit();

                        // If the process exited "too fast", we wait on the processes that were spawned by the process
                        // we started. This allow us to handle the case where the '.sln' is associated to an application like
                        // "VSLauncher.exe". That type of application only live for a short period of time because it's job
                        // is to analyse the sln file, launch the right version of "devenv.exe" (i.e. VS2002, VS2005, VS2008)
                        // and then exit.
                        // This "trick" should not be needed with others IDE like SharpDevelop.
                        if (DateTime.Now - startTime < TimeSpan.FromMinutes(1))
                        {
                            foreach (var processSpawned in ProcessEx.GetChildsOfProcess(process))
                            {
                                processSpawned.WaitForExit();
                            }
                        }
                    }

                    filterFile.StopFilteredSolutionWatcher();
                }
            }
        }
        public override void Run(string[] args, MessageBoxErrorReporter reporter)
        {
            var parsedArguments = new Arguments();
            reporter.CommandUsage = Parser.ArgumentsUsage(parsedArguments.GetType());

            if (Parser.ParseArguments(args, parsedArguments, reporter.Handler))
            {
                var filterFile = FilterFile.FromFile(parsedArguments.FilterFile);

                // Save the filtered solution. We also add a link to the original solution file in the filtered solution.
                // If we have to checkout the original solution file later on, its easier with that link.
                var filteredSolution = filterFile.Apply();

                // Add OriginalSolutionFile to the filter solution (and a warnings file if needed)
                filteredSolution.Projects.Add(CreateOriginalSolutionProject(filterFile.SourceSolution));

                filteredSolution.Save();
                if (filterFile.CopyReSharperFiles)
                {
                    var resharperGlobalFileSettingsSource = filterFile.SourceSolutionFullPath + ".DotSettings";
                    if (File.Exists(resharperGlobalFileSettingsSource))
                    {
                        File.Copy(resharperGlobalFileSettingsSource, filteredSolution.SolutionFullPath + ".DotSettings", true);
                    }

                    var resharperUserFileSettingsSource = filterFile.SourceSolutionFullPath + ".DotSettings.user";
                    var resharperUserFileSettingsDestination = filteredSolution.SolutionFullPath + ".DotSettings.user";
                    if (File.Exists(resharperUserFileSettingsSource) && !File.Exists(resharperUserFileSettingsDestination))
                    {
                        File.Copy(resharperUserFileSettingsSource, resharperUserFileSettingsDestination);
                    }
                }

                if (!parsedArguments.CreateOnly)
                {
                    filterFile.StartFilteredSolutionWatcher(
                                filteredSolution,
                                delegate(NodeDifference difference)
                                {
                                    using (var fix = new TopMostFormFix())
                                    {
                                        using (var form = new UpdateOriginalSolutionForm(difference, filterFile.SourceSolutionFullPath))
                                        {
                                            return (form.ShowDialog() == DialogResult.Yes);
                                        }
                                    }
                                });

                    var startTime = DateTime.Now;
                    var process = Process.Start(filteredSolution.SolutionFullPath);

                    if (parsedArguments.Wait || filterFile.WatchForChangesOnFilteredSolution)
                    {
                        process.WaitForExit();

                        // If the process exited "too fast", we wait on the processes that were spawned by the process
                        // we started. This allow us to handle the case where the '.sln' is associated to an application like
                        // "VSLauncher.exe". That type of application only live for a short period of time because it's job
                        // is to analyse the sln file, launch the right version of "devenv.exe" (i.e. VS2002, VS2005, VS2008)
                        // and then exit.
                        // This "trick" should not be needed with others IDE like SharpDevelop.
                        if (DateTime.Now - startTime < TimeSpan.FromMinutes(1))
                        {
                            foreach (var processSpawned in ProcessEx.GetChildsOfProcess(process))
                            {
                                processSpawned.WaitForExit();
                            }
                        }
                    }

                    filterFile.StopFilteredSolutionWatcher();
                }
            }
        }