public StatsEntry Get(string key) { StatsEntry entry = Dict[key]; if (entry == null) { throw new Exception("Unknown stats."); } return(entry); }
public void UpdateValue(string key, string newValue) { StatsEntry entry = Get(key); if (entry.Value != newValue) { entry.Value = newValue; Engine.Instance.OnStatsChange(entry); } }
public void Add(string key, string caption, string icon, string clickable) { StatsEntry entry = new StatsEntry(); entry.Key = key; entry.Caption = caption; entry.Icon = icon; entry.Clickable = clickable; Dict[key] = entry; List.Add(entry); }
public void Add(string key, string caption, string icon, bool dump) { StatsEntry entry = new StatsEntry(); entry.Key = key; entry.Caption = caption; entry.Icon = icon; entry.Dump = dump; Dict[key] = entry; List.Add(entry); }
public void UpdateValue(string key, string newValue) { StatsEntry entry = Get(key); if (entry.Value != newValue) { entry.Value = newValue; XmlItem xml = new XmlItem("command"); xml.SetAttribute("action", "ui.stats.change"); entry.WriteXML(xml); Engine.Instance.Command(xml); Engine.Instance.OnStatsChange(entry); } }
public virtual void OnStatsChange(StatsEntry entry) { }
public override void OnStatsChange(StatsEntry entry) { if (FormMain != null) FormMain.StatsChange(entry); }
public void StatsChange(StatsEntry entry) { if(this.InvokeRequired) { StatsChangeDelegate inv = new StatsChangeDelegate(this.StatsChange); this.BeginInvoke(inv, new object[] { entry }); } else { if (m_statsItems.ContainsKey(entry.Key)) { ListViewItemStats item = m_statsItems[entry.Key]; if (item.SubItems.Count == 1) item.SubItems.Add(""); item.SubItems[1].Text = entry.Text; } } }
public override void OnStatsChange(StatsEntry entry) { base.OnStatsChange (entry); if (MainWindow != null) if (MainWindow.TableStatsController != null) { new NSObject ().InvokeOnMainThread (() => { MainWindow.TableStatsController.RefreshUI (); }); } }