Example #1
0
        private static TipInfo GetTipAfterResetTipHistory(ref TipInfo nextTip)
        {
            // Check strange case - No new tips and no tips shown.
            if (_tipHistoryManager.GetTipHistory() == null)
            {
                // No tip found and there are none in the history, so we must have no tips at all. (Strange case)
                Debug.WriteLine("No tips seen and no tips yet to see. (Check if tip groups loaded correctly.)");
                return(null);
            }

            // Ask user if they want to clear the history and start again from the beginning.
            if (!ShouldResetHistory())
            {
                // User does not want to reset history. Exit nicely.
                return(null);
            }

            // Reset Tip History
            _tipHistoryManager.ClearTipHistory();

            // Fetch next tip
            return(_tipCalculator.GetNextTip());
        }
Example #2
0
 private void ClearTipHistory()
 {
     TipHistoryManager.ClearTipHistory();
 }