예제 #1
0
        private void UpdateButtons()
        {
            bool isEnabled = CacheProxy.IsStarted();

            BtnStart.IsEnabled = !isEnabled;
            BtnStop.IsEnabled  = isEnabled;

            BtnSaveConfiguration.IsEnabled = _isConfigurationDirty;
        }
예제 #2
0
        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();
        }
예제 #3
0
 private void BtnStop_Click(object sender, RoutedEventArgs e)
 {
     CacheProxy.Stop();
     UpdateButtons();
 }
예제 #4
0
 private void BtnStart_Click(object sender, RoutedEventArgs e)
 {
     CacheProxy.SetConfiguration(TbxRules.Text);
     CacheProxy.Start();
     UpdateButtons();
 }
예제 #5
0
 private void BtnClearCache_Click(object sender, RoutedEventArgs e)
 {
     CacheProxy.ClearCache();
     MessageBox.Show("Cache cleared");
 }
예제 #6
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     CacheProxy.Stop();
 }