Example #1
0
        public void OnItemUpdate(int phase, int itemPos, string itemName, IUpdateInfo update)
        {
            if (!App.checkPhase(phase))
            {
                return;
            }
            Dictionary <int, UpdateCell> TextMap;

            if (RowMap.TryGetValue(itemPos, out TextMap))
            {
                for (int i = 0; i < App.fields.Length; i++)
                {
                    string field = App.fields[i];
                    if (update.IsValueChanged(field) || update.Snapshot)
                    {
                        UpdateCell cell;
                        if (TextMap.TryGetValue(i, out cell))
                        {
                            cell.SetText(update.GetNewValue(field));
                            if (field.Equals("last_price"))
                            {
                                cell.Animate(update, field, TextMap);
                            }
                        }
                    }
                }
            }

            Debug.WriteLine("OnItemUpdate: " + itemName + ", " + update + ", pos: " + itemPos);
        }
Example #2
0
 public static string GetMapTextBy(string value)
 {
     if (TextMap != null)
     {
         if (TextMap.TryGetValue(value, out string result))
         {
             return(result);
         }
     }
     return(value);
 }
Example #3
0
 public Dictionary <string, string> GetCurrent(Locale language)
 => Defaults.ToDictionary(k => k.Key, v => TextMap.TryGetValue(v.Key, out var vals) && vals.TryGetValue(language, out var text) ? text : v.Value);