// Multihost constructor using JSON data from API public Multihost(JToken multihostProperties) { switch (multihostProperties.SelectToken("start_type").ToString()) { case "manual": startType = StartType.MANUAL; break; case "set_host": startType = StartType.SET_HOST; setHostName = multihostProperties.SelectToken("set_host_name").ToString(); break; case "random": startType = StartType.RANDOM; break; default: Common.ChatClient.SendMessage(string.Format("Host start type '{0}' is not valid. Defaulting to random.", multihostProperties.SelectToken("start_type").ToString()), Common.DryRun); return; } hosts = WebCalls.downloadMultihostStreamers().Result; rotator.Elapsed += rotatorTick; }
// Public method to refresh multihosts list public void refreshHostsList() { hosts = WebCalls.downloadMultihostStreamers().Result; }