/// <summary> /// Extra functionality added to the enable panel methods: disable gameplay if the passed panel requires gameplay disabled or paused (pause panel). /// Otherwise enables gameplay (HUD panel). /// </summary> protected override void ExtraEnableFunctionality(PanelDetails _panel) { if (_panel.disableGame) { DisableGame(true); } else { DisableGame(false); } }
private static void GetPanelDetails() { string requestUri = $"http://{PanelID}.ethosdistro.com/?json=yes"; HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUri); webRequest.Method = @"GET"; webRequest.Accept = @"application/json"; using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse()) { using (StreamReader reader = new StreamReader(webResponse.GetResponseStream())) { panel = JsonConvert.DeserializeObject <PanelDetails>(reader.ReadToEnd()); } } }
protected PanelDetails GetMinerDetails() { PanelDetails panel = null; try { using (EthosAPIController ethos = new EthosAPIController()) { panel = JsonConvert.DeserializeObject <PanelDetails>(ethos.GetEthosPanelData()); panel.HasAPIError = false; panel.UpdatedDateTime = DateTime.Now; } } catch (WebException ex) { panel = new PanelDetails { HasAPIError = true, ErrorMessage = ex.Message }; } return(panel); }
protected virtual void ExtraEnableFunctionality(PanelDetails _panel) { }
private void DataViewDialog_Scroll(object sender, ScrollEventArgs e) { PanelDetails.Update(); // Removes lag when scrolling }