private void SqlDependencyOnTableChanged(object sender, SqlDependencyEx.TableChangedEventArgs e)
 {
     OnDataUpdated?.Invoke(this, new DataUpdatedEventArgs
     {
         Action = (ActionType)e.NotificationType,
         Data   = e.Data
     });
 }
 private void Update()
 {
     if (_actionDataStamp != _dataStamp)
     {
         _actionDataStamp = _dataStamp;
         if (OnDataUpdated != null)
         {
             OnDataUpdated.Invoke();
         }
     }
 }
Beispiel #3
0
        public async Task Refresh(bool resetPaging = false)
        {
            if (resetPaging)
            {
                Paginator.Page = 1;
            }

            DisplayList = GetData();
            if (OnDataUpdated != null)
            {
                await OnDataUpdated.Invoke();
            }

            StateHasChanged();
        }
Beispiel #4
0
        private async void UpdateStock()
        {
            Users = await _dataLoader.GetUsers();

            Items = await _dataLoader.GetItems();

            StockData = await _dataLoader.GetStockData();

            foreach (var user in Users)
            {
                LoadUserImage(user);
            }

            foreach (var stockItem in StockData)
            {
                stockItem.Item = Items.Single(s => s.Id == stockItem.ItemId);
                stockItem.User = Users.Single(s => s.Id == stockItem.TraderId);
            }

            OnDataUpdated?.Invoke();
        }
    public static void UpdateEntry(DateTime day, AsthmaData data)
    {
        DateTime dateTime = day.Date + DateTime.Now.TimeOfDay;

        // if it's a new entry
        if (!_asthmaJsonObjectList.Contains(data))
        {
            _asthmaJsonObjectList.Add(data);

            OnFirstDataAdded?.Invoke(dateTime, data);
        }
        else
        {
            // update reminder
            OnDataUpdated?.Invoke(dateTime, data);
        }

        if (_trackerDictionary.ContainsKey(day))
        {
            // Debug.LogWarning($"Same date {day.ToLongDateString()} log data already exist. Updating it.");
            _trackerDictionary[day].UpdateData(data);
        }
        else
        {
            _trackerDictionary.Add(day, new LogData {
                asthmaData = data
            });
        }

        // update log file
        JSONObject o = new JSONObject();

        for (int i = 0; i < _asthmaJsonObjectList.Count; i++)
        {
            o.Add(_asthmaJsonObjectList[i].FormatToJson());
        }

        WriteToFile(GetPath(TrackerType.Asthma), o.Print(true));
    }
Beispiel #6
0
 private void NotifySubscribers()
 {
     UnityEditor.EditorApplication.update -= NotifySubscribers;
     OnDataUpdated?.Invoke();
 }