using KdanCommon.Helpers; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Windows.System; using Windows.UI; using Windows.UI.Xaml.Media.Animation; namespace KdanCommon.CMSCollection.Data { public partial class WindowsEventbarResponse { [JsonProperty("data")] public WindowsEventbarSetting[] Data { get; set; } } public partial class WindowsEventbarSetting : ISetting { [JsonConstructor] private WindowsEventbarSetting(string id, string app_type, DateTime start, DateTime end, string event_icon, string close_icon, string text_color, string background_color, EventbarInformation[] event_information, bool is_close_button_show) { if (close_icon != null) CloseIcon = new Uri($"{CMSCollection.CMSDomain}/assets/{close_icon}"); if (event_icon != null) EventIcon = new Uri($"{CMSCollection.CMSDomain}/assets/{event_icon}"); if (text_color != null) TextColor = text_color.ToColor(); if (background_color != null) BackgroundColor = background_color.ToColor(); Id = id; Start = start; End = end; if (event_information != null) { EventbarInformation = event_information.FirstOrDefault(); } IsCloseButtonShow = is_close_button_show; } public string SettingName { get { return Id; } } public string Id { get; } public DateTime Start { get; } public DateTime End { get; } public Color TextColor { get; } public Color BackgroundColor { get; } public EventbarInformation EventbarInformation { get; } public Uri EventIcon { get; } public Uri CloseIcon { get; } public bool IsCloseButtonShow { get; } } public partial class EventbarInformation { [JsonProperty("event_title")] public string EventTitle { get; set; } [JsonProperty("event_link")] public string EventLink { get; set; } } }