private void btn_Submit_Click(object sender, EventArgs e) { this.OutputSequences = ""; if (string.IsNullOrEmpty(this.InputSequences)) { MessageBox.Show("Please do not submit empty content. "); return; } FastaParser parser = new FastaParser(this.InputSequences); List <FastaEntry> fastaEntries = parser.ParseFasta(); if (fastaEntries == null) { switch (this.Countpart) { case CountpartType.ReverseComplement: this.OutputSequences = SequenceGenerator.ReverseComplementSequence(this.InputSequences); break; case CountpartType.Reverse: this.OutputSequences = SequenceGenerator.ReverseSequence(this.InputSequences); break; case CountpartType.Complement: this.OutputSequences = SequenceGenerator.ComplementSequence(this.InputSequences); break; default: MessageBox.Show("Please choose a counterpart. "); break; } this.rtx_OutputSequences.Text = this.OutputSequences; return; } foreach (FastaEntry f in fastaEntries) { switch (this.Countpart) { case CountpartType.ReverseComplement: f.Sequence = new StringBuilder(SequenceGenerator.ReverseComplementSequence(f.Sequence.ToString())); break; case CountpartType.Reverse: f.Sequence = new StringBuilder(SequenceGenerator.ReverseSequence(f.Sequence.ToString())); break; case CountpartType.Complement: f.Sequence = new StringBuilder(SequenceGenerator.ComplementSequence(f.Sequence.ToString())); break; default: MessageBox.Show("Please choose a counterpart. "); break; } } foreach (FastaEntry entry in fastaEntries) { this.OutputSequences += entry.ToString(); } this.rtx_OutputSequences.Text = this.OutputSequences; }