Exemplo n.º 1
0
        private static void onClearCache(object sender, RoutedEventArgs e)
        {
            var result = MessageBox.Show(mainWindow,
                                         "This will remove your Toggl user data from this PC and log you out of the Toggl Desktop app. " +
                                         "Any unsynced data will be lost.\n\nDo you want to continue?", "Clear Cache",
                                         MessageBoxButton.OKCancel, "CLEAR CACHE");

            if (result == MessageBoxResult.OK)
            {
                Toggl.ClearCache();
            }
        }
Exemplo n.º 2
0
        private void clearCacheToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dr;

            try
            {
                DisableTop();
                dr = MessageBox.Show(
                    "This will remove your Toggl user data from this PC and log you out of the Toggl Desktop app. " +
                    "Any unsynced data will be lost." +
                    Environment.NewLine + "Do you want to continue?",
                    "Clear Cache",
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }
            finally
            {
                EnableTop();
            }
            if (DialogResult.Yes == dr)
            {
                Toggl.ClearCache();
            }
        }