private void btnMakeBB_Click(object sender, RoutedEventArgs e)
        {
            SignatureCampaign mySig = new SignatureCampaign();

            mySig.Abbrev        = (string)cmbxAbbrev.SelectedItem;
            mySig.Name          = txtName.Text;
            mySig.Link          = txtLink.Text;
            mySig.CampaignType  = (string)cmbxType.SelectedItem;
            mySig.LegendaryRate = decimal.Parse(txtRateLegendary.Text);
            mySig.HeroRate      = decimal.Parse(txtRateHero.Text);
            mySig.SrRate        = decimal.Parse(txtRateSr.Text);
            mySig.FullRate      = decimal.Parse(txtRateFull.Text);
            mySig.MemberRate    = decimal.Parse(txtRateMem.Text);
            mySig.JrRate        = decimal.Parse(txtRateJr.Text);
            mySig.NewbRate      = decimal.Parse(txtRateNewb.Text);
            mySig.MinPost       = txtMin.Text;
            mySig.MaxPost       = txtMax.Text;
            mySig.Escrow        = (string)cmbxEscrow.SelectedItem;

            //mySig is added to a List to give the ability to use CustomBBCode.MakeTable()
            //and create the entire table instead of just one row
            List <SignatureCampaign> allSigs = new List <SignatureCampaign>();

            allSigs.Add(mySig);

            txtResult.Text = CustomBBCode.MakeTable(allSigs);
        }
示例#2
0
        public static string MakeTableRow(SignatureCampaign sig)
        {
            StringBuilder result = new StringBuilder();

            result.AppendLine("[tr]");

            result.AppendLine(MakeTableCell(ChageAbbrevString(sig.Abbrev.ToString())));
            result.AppendLine(MakeTableCell(AddURL(sig.Name, sig.Link)));
            result.AppendLine(MakeTableCell(sig.CampaignType));
            result.AppendLine(MakeTableCell(sig.LegendaryRate.ToString()));
            result.AppendLine(MakeTableCell(sig.HeroRate.ToString()));
            result.AppendLine(MakeTableCell(sig.SrRate.ToString()));
            result.AppendLine(MakeTableCell(sig.FullRate.ToString()));
            result.AppendLine(MakeTableCell(sig.MemberRate.ToString()));
            result.AppendLine(MakeTableCell(sig.JrRate.ToString()));
            result.AppendLine(MakeTableCell(sig.NewbRate.ToString()));
            result.AppendLine(MakeTableCell(sig.MinPost));
            result.AppendLine(MakeTableCell(sig.MaxPost));
            result.AppendLine(MakeTableCell(ChangeEscrowString(sig.Escrow)));

            result.Append("[/tr]");
            return(result.ToString());
        }