예제 #1
0
        public ConfigurationWindow()
        {
            InitializeComponent();

            missionsData.ItemsSource = missionMonitor()?.missions;

            MissionMonitorConfiguration configuration = MissionMonitorConfiguration.FromFile();

            missionWarningInt.Text = configuration.missionWarning?.ToString(CultureInfo.InvariantCulture);
        }
예제 #2
0
        public ConfigurationWindow()
        {
            InitializeComponent();

            monitor = ((MissionMonitor)EDDI.Instance.ObtainMonitor("Mission monitor"));
            missionsData.ItemsSource = monitor.missions;

            MissionMonitorConfiguration configuration = MissionMonitorConfiguration.FromFile();

            missionWarningInt.Text = configuration.missionWarning?.ToString(CultureInfo.InvariantCulture);
        }
예제 #3
0
        private void warningChanged(object sender, TextChangedEventArgs e)
        {
            MissionMonitorConfiguration configuration = MissionMonitorConfiguration.FromFile();

            try
            {
                int?warning = string.IsNullOrWhiteSpace(missionWarningInt.Text) ? 60 : Convert.ToInt32(missionWarningInt.Text, CultureInfo.InvariantCulture);
                ((MissionMonitor)EDDI.Instance.ObtainMonitor("Mission monitor")).missionWarning = warning;
                configuration.missionWarning = warning;
                configuration.ToFile();
            }
            catch
            {
                // Bad user input; ignore it
            }
        }