source: 2014/tet/FileWatcher/FileWatcher/Options.xaml.cs @ 5261

Revision 4833, 1.7 KB checked in by anlakane, 7 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Controls;
7using System.Windows.Data;
8using System.Windows.Documents;
9using System.Windows.Input;
10using System.Windows.Media;
11using System.Windows.Media.Imaging;
12using System.Windows.Shapes;
13
14namespace FileWatcher
15{
16    /// <summary>
17    /// Interaction logic for Options.xaml
18    /// </summary>
19    public partial class Options : Window
20    {
21        public Options()
22        {
23            InitializeComponent();
24            optionsLoad.IsChecked = Program.LoadSettingsAutomatically;
25            optionsSave.IsChecked = Program.SaveSettingsAutomatically;
26            autoStart.IsChecked = Program.StartWatchingAutomatically;
27            logBox.IsChecked = Program.KeepLog;
28        }
29
30        private void cancelButton_Click(object sender, RoutedEventArgs e)
31        {
32            Close();
33        }
34
35        private void doneButton_Click(object sender, RoutedEventArgs e)
36        {
37            Program.LoadSettingsAutomatically = (bool)optionsLoad.IsChecked;
38            Program.SaveSettingsAutomatically = (bool)optionsSave.IsChecked;
39            Program.StartWatchingAutomatically = (bool)autoStart.IsChecked;
40            Program.KeepLog = (bool)logBox.IsChecked;
41            Program.SaveSettings();
42            Close();
43        }
44
45        private void optionsLoad_Checked(object sender, RoutedEventArgs e)
46        {
47            autoStart.IsEnabled = true;
48        }
49
50        private void optionsLoad_Unchecked(object sender, RoutedEventArgs e)
51        {
52            autoStart.IsEnabled = false;
53            autoStart.IsChecked = false;
54        }
55    }
56}
Note: See TracBrowser for help on using the repository browser.