private LayoutChoice_Set MakeSublayout(AppContribution contribution) { // get some properties AppContributor who = contribution.Contributor; string name = who.Name; string when = contribution.DateTime.ToString("yyyy-MM-dd"); string description = contribution.Description; double fontSize = 16; double nameSize = 30; // build the name button layout LayoutChoice_Set nameLayout; if (who.Email != null || who.Website != null) { // If this contributor provided details, then make a button to show those details Vertical_GridLayout_Builder detailBuilder = new Vertical_GridLayout_Builder(); detailBuilder.AddLayout(new TextblockLayout("Contributor Name: " + name, fontSize)); if (who.Email != null) { detailBuilder.AddLayout(new TextblockLayout("Email: " + who.Email, fontSize)); } if (who.Website != null) { detailBuilder.AddLayout(new TextblockLayout("Website: " + who.Website, fontSize)); } nameLayout = new HelpButtonLayout(name, detailBuilder.Build(), layoutStack, nameSize); } else { // If this contributor didn't provide details, then just display their name TextblockLayout l = new TextblockLayout(name, nameSize); l.AlignHorizontally(TextAlignment.Center); nameLayout = l; } // build the rest of the layout Vertical_GridLayout_Builder fullBuilder = new Vertical_GridLayout_Builder(); fullBuilder.AddLayout(nameLayout); fullBuilder.AddLayout(new TextblockLayout("On " + when + ": " + description, fontSize)); fullBuilder.AddLayout(new TextblockLayout("Thanks!", fontSize)); return(fullBuilder.Build()); }
public AppContribution(AppContributor contributor, DateTime when, string description) { this.Contributor = contributor; this.DateTime = when; this.Description = description; }
public CreditsWindowBuilder AddContribution(AppContributor who, DateTime when, string description) { return(this.AddContribution(new AppContribution(who, when, description))); }
public CreditsButtonBuilder AddContribution(AppContributor who, DateTime when, string description) { this.contentBuilder.AddContribution(who, when, description); return(this); }