public BetterMessageBoxFluentInterface <T> StandardImage(StandardImageKind imageKind) { byte[] imageData; switch (imageKind) { case StandardImageKind.Error: imageData = BetterMessageBoxStandardIcons.Error48; break; case StandardImageKind.Warning: imageData = BetterMessageBoxStandardIcons.Warning48; break; case StandardImageKind.Question: imageData = BetterMessageBoxStandardIcons.Question48; break; case StandardImageKind.Success: imageData = BetterMessageBoxStandardIcons.Success48; break; default: throw new ArgumentException("imageKind"); } using (MemoryStream stream = new MemoryStream(imageData)) { Image image = System.Drawing.Image.FromStream(stream); BetterMessageBoxData = BetterMessageBoxData.WithImage(image); } return(this); }
public static BetterMessageBoxFluentInterface <T> StandardImage(StandardImageKind imageKind) => new BetterMessageBoxFluentInterface <T>().StandardImage(imageKind);