static void MainHandler(Object source, System.Timers.ElapsedEventArgs e) { string outStr = ""; foreach (var hardwareItem in myComputer.Hardware) { hardwareItem.Update(); hardwareItem.GetReport(); outStr += String.Format("<div class='row'><div class='col-xs-12'><h1>{0}</h1></div></div>", hardwareItem.Name); foreach (var sensor in hardwareItem.Sensors) { if (sensor.SensorType == SensorType.Temperature) { outStr += String.Format("<div class='row'><div class='col-xs-8'>{0}</div><div class='col-xs-4'>{1}C</div></div>", sensor.Name, sensor.Value); } if (sensor.SensorType == SensorType.Load) { outStr += String.Format("<div class='row'><div class='col-xs-8'>{0}</div><div class='col-xs-4 vcenter'><div class='progress'><div class='progress-bar' role='progressbar' aria-valuenow='{1}' aria-minvalue='0' aria-maxvalue='100' style='width:{1}%'></div></div></div></div>", sensor.Name, Math.Round(Convert.ToDouble(sensor.Value))); } } } LogitechArx.LogiArxSetTagContentById("test", outStr); }
private async void updateSubscriber() { if (twitchChannel != null) { if (twitchChannel.partner.Value) { try { Total <List <Subscription <User> > > subs = await twitchUser.RetriveSubscribers(); string text = "<ul>"; foreach (Subscription <User> sub in subs.wrapped) { text += "<li>" + sub.wrapped.name.ToString() + "</li>"; } text += "</ul>"; LogitechArx.LogiArxSetTagContentById("last_subs", text); } catch { } } else { LogitechArx.LogiArxSetTagContentById("last_subs", "No partner"); } } }
private void updateChannelInfo() { if (twitchChannel != null) { LogitechArx.LogiArxSetTagContentById("channel_views", twitchChannel.views.ToString()); LogitechArx.LogiArxSetTagContentById("followers", twitchChannel.followers.ToString()); LogitechArx.LogiArxSetTagContentById("mature", twitchChannel.mature.ToString()); } }
private void updateIRC() { Debug.Print("Update IRC"); if (irc != null) { try { List <String> messages = irc.GetMessages(); string text = "<ul>"; foreach (String message in messages) { text += "<li>" + message + "</li>"; } text += "</ul>"; LogitechArx.LogiArxSetTagContentById("chat_messages", text); } catch { } } }
private async void updateStreamInfo() { Debug.Print("Update Stream Info"); Stream twitchStream = null; try { twitchStream = await twitchClient.RetrieveStream(twitchUser.name.ToString()); LogitechArx.LogiArxSetTagContentById("average_fps", twitchStream.averageFps.ToString()); LogitechArx.LogiArxSetTagContentById("game", twitchStream.game.ToString()); LogitechArx.LogiArxSetTagContentById("viewers", twitchStream.viewers.ToString()); LogitechArx.LogiArxSetTagContentById("video_quality", twitchStream.videoHeight.ToString() + "p"); LogitechArx.LogiArxSetTagContentById("status", twitchChannel.status.ToString()); if (twitchChannel.delay.ToString() != "") { LogitechArx.LogiArxSetTagContentById("delay", twitchChannel.delay.ToString()); } else { LogitechArx.LogiArxSetTagContentById("delay", "None"); } } catch { LogitechArx.LogiArxSetTagContentById("average_fps", ""); LogitechArx.LogiArxSetTagContentById("game", ""); LogitechArx.LogiArxSetTagContentById("viewers", ""); LogitechArx.LogiArxSetTagContentById("video_quality", ""); LogitechArx.LogiArxSetTagContentById("status", "Stream offline!"); LogitechArx.LogiArxSetTagContentById("delay", ""); } if (twitchChannel != null) { if (!twitchChannel.partner.Value) { LogitechArx.LogiArxSetTagPropertyById("commercial_card", "hidden", "true"); } } }