Esempio n. 1
0
        public StatsEntry Get(string key)
        {
            StatsEntry entry = Dict[key];

            if (entry == null)
            {
                throw new Exception("Unknown stats.");
            }
            return(entry);
        }
Esempio n. 2
0
        public void UpdateValue(string key, string newValue)
        {
            StatsEntry entry = Get(key);

            if (entry.Value != newValue)
            {
                entry.Value = newValue;
                Engine.Instance.OnStatsChange(entry);
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 6
0
 public virtual void OnStatsChange(StatsEntry entry)
 {
 }
Esempio n. 7
0
 public override void OnStatsChange(StatsEntry entry)
 {
     if (FormMain != null)
         FormMain.StatsChange(entry);
 }
Esempio n. 8
0
 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;
         }
     }
 }
Esempio n. 9
0
        public override void OnStatsChange(StatsEntry entry)
        {
            base.OnStatsChange (entry);

            if (MainWindow != null)
            if (MainWindow.TableStatsController != null) {
                new NSObject ().InvokeOnMainThread (() => {
                    MainWindow.TableStatsController.RefreshUI ();
                });
            }
        }
Esempio n. 10
0
 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);
 }