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(); } }
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(); } }