private void btOk_Click(object sender, RoutedEventArgs e) { MTSettingsModel objOldSettings = MTControler.Settings; MTControler.Settings = _objNewSettings; if (objOldSettings.AutoTestEnabled != _objNewSettings.AutoTestEnabled) { if (_objNewSettings.AutoTestEnabled) { MTControler.AutoTestWorker.RunWorkerAsync(); } else { MTControler.MainView.lbTimer.Content = "Auto test desabled"; } } if (objOldSettings.AutoTestInterval != _objNewSettings.AutoTestInterval) { MTControler.TimeRemaining = new DateTime().AddMinutes(_objNewSettings.AutoTestInterval); } //Update MTClassificator.UpdateAllPositions(); //Write XML MTParser.WriteSettings(); this.Close(); }
private void header_Click(object sender, RoutedEventArgs e) { CloseCurrentPopup(); GridViewColumnHeader header = sender as GridViewColumnHeader; if (header.Name == "heText") { MTControler.Settings.EnSortOrder = SortOrder.Text; } else if (header.Name == "heApply") { MTControler.Settings.EnSortOrder = SortOrder.Applycations; } else if (header.Name == "heDate") { MTControler.Settings.EnSortOrder = SortOrder.Date; } else if (header.Name == "hePosition") { MTControler.Settings.EnSortOrder = SortOrder.PositionBrain; } else if (header.Name == "heProgress") { MTControler.Settings.EnSortOrder = SortOrder.Progress; } else if (header.Name == "heNumTest") { MTControler.Settings.EnSortOrder = SortOrder.TestTotal; } else if (header.Name == "heAnsuersCorrects") { MTControler.Settings.EnSortOrder = SortOrder.TestCorrects; } else if (header.Name == "heAnsuersWrongs") { MTControler.Settings.EnSortOrder = SortOrder.TestWrongs; } else if (header.Name == "hePercentsWrongs") { MTControler.Settings.EnSortOrder = SortOrder.TestWrongPercents; } else if (header.Name == "heCreated") { MTControler.Settings.EnSortOrder = SortOrder.Created; } //header.Background = new SolidColorBrush(Colors.LightPink); MTClassificator.UpdateAllPositions(); MTParser.WriteSettings(); }