public override bool PrepareOptions()
        {
            foreach (var inputfile in this.InputFiles)
            {
                if (!File.Exists(inputfile))
                {
                    ParsingErrors.Add(string.Format("Input file not exists {0}.", inputfile));
                }
            }

            var engine = GetSearchEngineType();

            if (engine == SearchEngineType.Unknown)
            {
                if (!this.EngineType.ToLower().Equals("help"))
                {
                    ParsingErrors.Add(string.Format("Unknown search engine type {0}", this.EngineType));
                }
                ParsingErrors.Add(string.Format("  Those engines are valid: {0}", (GetValidEngines()).Merge(", ")));
            }

            if (!string.IsNullOrEmpty(TitleType) && TitleParserUtils.FindByName(TitleType) == null)
            {
                if (!this.TitleType.ToLower().Equals("help"))
                {
                    ParsingErrors.Add(string.Format("Unknown title type {0}.", this.TitleType));
                }
                ParsingErrors.Add("  Those titles are valid:");
                (from t in TitleParserUtils.GetTitleParsers()
                 select t.FormatName).ToList().ForEach(m => ParsingErrors.Add("    " + m));
            }

            if (Rank2 && engine != SearchEngineType.Unknown)
            {
                foreach (var inputfile in InputFiles)
                {
                    try
                    {
                        var parser = engine.GetFactory().GetParser(inputfile, this.Rank2);
                    }
                    catch (Exception ex)
                    {
                        ParsingErrors.Add(ex.Message);
                        break;
                    }
                }
            }

            return(ParsingErrors.Count == 0);
        }
        public PeptideSpectrumMatchDistillerUI()
        {
            InitializeComponent();

            this.searchResultFiles.FileArgument = new OpenFileArgument("Search Result", "*");

            var parsers = TitleParserUtils.GetTitleParsers().ToArray();

            this.titleParsers = new RcpaComboBox <ITitleParser>(this.cbTitleFormat, "TitleFormat", parsers, parsers.Length - 1, true);
            AddComponent(this.titleParsers);

            var engineNames = PeptideSpectrumMatchDistillerOptions.GetValidEngines();

            this.engines = new RcpaComboBox <string>(this.cbEngines, "Engine", engineNames, 0);
            AddComponent(this.engines);

            this.Text = Constants.GetSQHTitle(Title, Version);
        }