Exemple #1
0
        /// <summary>
        /// Store the current match to the local datastore
        /// </summary>
        public async Task StoreMatch(vmMatch _vmMatch)
        {
            //Store the match
            await StoredMatches.Update(_vmMatch);

            //Save the stored matches
            await StoredMatches.Save();

            //Update and save total statistics
            TotalStatistics.Add(_vmMatch);
            await TotalStatistics.Save();

            //Fire event
            OnMatchStored(EventArgs.Empty);
        }
Exemple #2
0
        /// <summary>
        /// Remove the current match from the stored matches in the local datastore
        /// </summary>
        public async void RemoveMatch(Guid ID)
        {
            await StoredMatches.RemoveAndDelete(ID);

            StoredMatches.Save();

            TotalStatistics.Remove(ID);
            TotalStatistics.Save();

            if (CurrentMatch != null)
            {
                if (CurrentMatch.Match != null)
                {
                    if (CurrentMatch.Match.ID == ID)
                    {
                        CurrentMatch = null;
                    }
                }
            }

            //Fire event
            OnMatchStored(EventArgs.Empty);
        }