/// <summary> /// Initializes a new instance of the <see cref="ContextualNotification"/> class. /// </summary> /// <param name="store">The store.</param> public ContextualNotification(IDictionary <string, object> store) { this.info = new ContextualNotificationData(store, "Info"); this.success = new ContextualNotificationData(store, "Notice"); this.warning = new ContextualNotificationData(store, "Warning"); this.error = new ContextualNotificationData(store, "Error"); }
private void Set(ref ContextualNotificationData flash, ContextualNotificationData newValue) { if (newValue.Type != ContextualNotificationData.DefaultType) { throw new InvalidCastException("Cannot set a flash that is not new"); } flash.Clear(); flash.Add(newValue); }