コード例 #1
0
ファイル: main_window.cs プロジェクト: erplsf/Principia
            public override void Load(ConfigNode node)
            {
                base.Load(node);

                string show_ksp_features_value =
                    node.GetAtMostOneValue("show_ksp_features");

                if (show_ksp_features_value != null)
                {
                    show_ksp_features_ = Convert.ToBoolean(show_ksp_features_value);
                }
                string show_logging_settings_value =
                    node.GetAtMostOneValue("show_logging_settings");

                if (show_logging_settings_value != null)
                {
                    show_logging_settings_ = Convert.ToBoolean(show_logging_settings_value);
                }
                string show_prediction_settings_value =
                    node.GetAtMostOneValue("show_prediction_settings");

                if (show_prediction_settings_value != null)
                {
                    show_prediction_settings_ =
                        Convert.ToBoolean(show_prediction_settings_value);
                }

                string history_length_value = node.GetAtMostOneValue("history_length");

                if (history_length_value != null)
                {
                    history_length_.value = Convert.ToDouble(history_length_value);
                }

                string buffered_logging_value = node.GetAtMostOneValue("buffered_logging");

                if (buffered_logging_value != null)
                {
                    buffered_logging_ = Convert.ToInt32(buffered_logging_value);
                }
                string stderr_logging_value = node.GetAtMostOneValue("stderr_logging");

                if (stderr_logging_value != null)
                {
                    stderr_logging_ = Convert.ToInt32(stderr_logging_value);
                }
                string suppressed_logging_value =
                    node.GetAtMostOneValue("suppressed_logging");

                if (suppressed_logging_value != null)
                {
                    suppressed_logging_ = Convert.ToInt32(suppressed_logging_value);
                }
                string verbose_logging_value = node.GetAtMostOneValue("verbose_logging");

                if (verbose_logging_value != null)
                {
                    verbose_logging_ = Convert.ToInt32(verbose_logging_value);
                }

                string must_record_journal_value =
                    node.GetAtMostOneValue("must_record_journal");

                if (must_record_journal_value != null)
                {
                    must_record_journal_ = Convert.ToBoolean(must_record_journal_value);
                }

                Log.SetBufferedLogging(buffered_logging_);
                Log.SetSuppressedLogging(suppressed_logging_);
                Log.SetStderrLogging(stderr_logging_);
                Log.SetVerboseLogging(verbose_logging_);

                if (must_record_journal_)
                {
                    journaling_ = true;
                    Log.ActivateRecorder(true);
                }
            }