private void UpdateButtons() { bool isEnabled = CacheProxy.IsStarted(); BtnStart.IsEnabled = !isEnabled; BtnStop.IsEnabled = isEnabled; BtnSaveConfiguration.IsEnabled = _isConfigurationDirty; }
private void BtnSaveConfiguration_Click(object sender, RoutedEventArgs e) { SaveConfiguration(TbxRules.Text); try { CacheProxy.SetConfiguration(TbxRules.Text); } catch (Exception ex) { MessageBox.Show("The configuration is not valid. " + ex.Message); } UpdateButtons(); }
private void BtnStop_Click(object sender, RoutedEventArgs e) { CacheProxy.Stop(); UpdateButtons(); }
private void BtnStart_Click(object sender, RoutedEventArgs e) { CacheProxy.SetConfiguration(TbxRules.Text); CacheProxy.Start(); UpdateButtons(); }
private void BtnClearCache_Click(object sender, RoutedEventArgs e) { CacheProxy.ClearCache(); MessageBox.Show("Cache cleared"); }
private void Application_Exit(object sender, ExitEventArgs e) { CacheProxy.Stop(); }