示例#1
0
        public Nastavení(delegátProObnoveníInformací obnovZobrazenéInformace, ThemeChooser themeChooser, MainWindow okno)
        {
            this.okno = okno;
            InitializeComponent();
            this.themeChooser = themeChooser;
            this.obnovZobrazenéInformace = obnovZobrazenéInformace;
            ZobrazDokončenéÚkoly = false;
            ZobrazOdloženéTesty = false;

            if (!File.Exists(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Info", "Nastavení", "nastaveni.dat")))
            {
                okno.výběrSkupinyComboBox.SelectedIndex = 0;
                uložData();
            }
            try
            {
                XmlDocument document = new XmlDocument();
                document.Load((System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Info", "Nastavení", "nastaveni.dat")));
                XmlElement nastaveni = ((XmlElement)document.GetElementsByTagName("nastaveni")[0]);
                dokončenéÚkolyCheckBox.IsChecked = Boolean.Parse(nastaveni.GetAttribute("odlozeneTesty")); //TODO doděkalt synchronizaci hodnot zobrazených v GUI mezi hodnotami v proměnných proh´gramiu
                odloženéTestyCheckBox.IsChecked = Boolean.Parse(nastaveni.GetAttribute("dokonceneUkoly"));
                okno.výběrSkupinyComboBox.SelectedIndex = int.Parse(nastaveni.GetAttribute("skupina")) - 1;
                okno.Width = Double.Parse(nastaveni.GetAttribute("sirkaOkna"));
                okno.Height = Double.Parse(nastaveni.GetAttribute("vyskaOkna"));
            }
            catch (Exception e)
            {
                MessageBox.Show("Došlo k chybě při čtení ze souboru nastavení: " + e.Message, "CHYBA");
            }
        }
示例#2
0
 public Settings(MainWindow window, Action refresh)
 {
     ImportantMessage += delegate { };
     Error += delegate { };
     Refresh += refresh;
     this.window = window;
     InitializeComponent();
     ShowDokončenéÚkoly = false;
     ShowOdloženéTesty = false;
 }
示例#3
0
 private void enterButton_Click(object sender, RoutedEventArgs e)
 {
     if (hesloBox.Password.Contains(""))
     {
         string pass = hesloBox.Password;
         MessageBox.Show("Heslo přijato!", "Výýýýýýýýýborně", MessageBoxButton.OK, MessageBoxImage.Information);
         MainWindow mw = new MainWindow();
         mw.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("Špatné heslo\nZkuste to znovu", "Nesmysl, špatně!", MessageBoxButton.OK, MessageBoxImage.Error);
         hesloBox.Clear();
     }
 }
示例#4
0
 public ThemeChooser(MainWindow okno)
 {
     InitializeComponent();
     this.okno = okno;
 }