public GrowlNotification(string heading, string message, GrowlNotificationStyle style) { this.Heading = heading; this.Message = message; switch (style) { case GrowlNotificationStyle.Success: this.Message = "success"; break; case GrowlNotificationStyle.Warning: this.Message = "warning"; break; case GrowlNotificationStyle.Danger: this.Message = "danger"; break; default: throw new ArgumentOutOfRangeException(nameof(style), style, null); } }
public static T WithGrowlMessage <T>(this T response, string heading, string message, GrowlNotificationStyle style) where T : FormResponse <MyFormResponseMetadata> { response.Metadata = response.Metadata ?? new MyFormResponseMetadata(); response.Metadata.FunctionsToRun = response.Metadata.FunctionsToRun ?? new List <ClientFunctionMetadata>(); var growlFunction = new GrowlNotification(heading, message, style).GetClientFunctionMetadata(); response.Metadata.FunctionsToRun.Add(growlFunction); return(response); }
public static T WithGrowlMessage <T>(this T response, string message, GrowlNotificationStyle style) where T : FormResponse <MyFormResponseMetadata> { return(response.WithGrowlMessage(null, message, style)); }
public GrowlNotification(string message, GrowlNotificationStyle style) : this(null, message, style) { }