private void GetButtons(StreamingLiveLib.Buttons buttons) { }
public string LoadJson() { StreamingLiveLib.Buttons buttons = StreamingLiveLib.Buttons.LoadBySiteId(this.Id); StreamingLiveLib.Tabs tabs = StreamingLiveLib.Tabs.LoadBySiteId(this.Id); StreamingLiveLib.Services services = StreamingLiveLib.Services.LoadBySiteId(this.Id); JObject data = new JObject(); data["colors"] = new JObject() { { "primary", this.PrimaryColor }, { "contrast", this.ContrastColor }, { "header", this.HeaderColor } }; data["logo"] = new JObject() { { "url", this.HomePageUrl }, { "image", this.LogoUrl } }; JArray buttonArray = new JArray(); foreach (StreamingLiveLib.Button button in buttons) { buttonArray.Add(new JObject() { { "text", button.Text }, { "url", button.Url } }); } data["buttons"] = buttonArray; JArray tabArray = new JArray(); foreach (StreamingLiveLib.Tab tab in tabs) { tabArray.Add(new JObject() { { "text", tab.Text }, { "icon", tab.Icon }, { "url", tab.Url }, { "type", tab.TabType }, { "data", tab.TabData } }); } data["tabs"] = tabArray; JArray serviceArray = new JArray(); foreach (StreamingLiveLib.Service service in services) { serviceArray.Add(new JObject() { { "videoUrl", service.VideoUrl }, { "serviceTime", service.ServiceTime.ToString("yyyy-MM-dd") + "T" + service.ServiceTime.ToString("HH:mm") }, { "duration", Utils.GetDisplayDuration(service.Duration) }, { "earlyStart", Utils.GetDisplayDuration(service.EarlyStart) }, { "chatBefore", Utils.GetDisplayDuration(service.ChatBefore) }, { "chatAfter", Utils.GetDisplayDuration(service.ChatAfter) }, { "provider", service.Provider }, { "providerKey", service.ProviderKey } }); } data["services"] = serviceArray; string result = data.ToString(Formatting.Indented); return(result); }
private void LoadData() { buttons = StreamingLiveLib.Buttons.LoadBySiteId(AppUser.Current.Site.Id); }