Exemple #1
0
        public static void AddRange(string key, IEnumerable <object> values)
        {
            if (values.Count() == 0)
            {
                return;
            }

            if (!Log.ContainsKey(key))
            {
                Log[key] = new ObservableCollection <object>();
            }

            foreach (var value in values)
            {
                if (value is string str)
                {
                    Log[key].Add(new StringLog(str));
                }
                else
                {
                    Log[key].Add(value);
                }
            }

            LoggerUpdated?.Invoke(key, values.Last());
        }
Exemple #2
0
        public static void Add(string key, object value)
        {
            if (!Log.ContainsKey(key))
            {
                Log[key] = new ObservableCollection <object>();
            }

            if (value is string str)
            {
                Log[key].Add(new StringLog(str));
            }
            else
            {
                Log[key].Add(value);
            }

            LoggerUpdated?.Invoke(key, value);
        }