1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 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; }
- }
- }
|