public void AddNumCounter(string numCounterKey, NumCounterItem numCounterItem) { NumCounterView view = new NumCounterView(); view.Name = numCounterKey; view.CounterName = numCounterItem.Name; view.CounterValue = 0; view.SetImage(Program.LogicHandler.ServicesProvider.ImagesService.GetNumCounterBackground(numCounterItem.Code)); numCountersContainer.Controls.Add(view); }
public NumCounterItem GetByCode(string code) { NumCounterItem item = null; XmlNode nodeItem = nodes.SelectSingleNode(string.Concat("item[@code='", code, "']")); if(nodeItem != null) { XmlNode nodeLang = nodesLang.SelectSingleNode(string.Concat("item[@code='", nodeItem.Attributes["code"].Value, "']")); item = new NumCounterItem(nodeItem, nodeLang); } return item; }
public void AddNumCounter(string playerKey, string numCounterKey, NumCounterItem numCounterItem) { if(InvokeRequired) Invoke(new Action<string, string, NumCounterItem>(AddNumCounter), playerKey, numCounterKey, numCounterItem); { try { foreach(PlayerStatusView playerStatusView in Controls.Find(playerKey, true).OfType<PlayerStatusView>()) playerStatusView.AddNumCounter(numCounterKey, numCounterItem); } catch(Exception ex) { HandleException(ex); } } }
public void UpdateNumCounter(string key, NumCounterItem numCounterItem) { if(InvokeRequired) Invoke(new Action<string, NumCounterItem>(UpdateNumCounter), key, numCounterItem); else { try { foreach(NumCounterView view in Controls.Find(key, true)) view.Name = numCounterItem.Name; } catch(Exception ex) { HandleException(ex); } } }
public void UpdateData(NumCounterItem newData) { Data.Name = newData.Name; OnDataChanged(); }
public NumCounterModel(string key, NumCounterItem numCounter) : base(key) { this.Data = numCounter; this.Value = new ObservableProperty<int, NumCounterModel>(this, 0); }