Example #1
0
        /// <summary>
        /// Called to Configure an Algorithm's Custom Settings Definition.
        /// </summary>
        /// <param name="algorithmSettings">Settings defined by the Algorithm Developer.</param>
        public void DefineCustomAlgorithmSettings(AlgorithmSettings algorithmSettings)
        {
            var algorithmName = algorithmSettings.AlgorithmName;

            //Called from each Algorithm at startup, to Define the Custom Settings for each algorithm.
            AllAlgorithmSettings.TryAdd(algorithmName, algorithmSettings);

            //Try to Load and override any settings the user has specified previously.
            LoadCustomUserSettings(algorithmName);
        }
        internal void ShowSettingsForm(AlgorithmSettings settings)
        {
            //Set a reference to the Settings.
            _settings = settings;

            //Set the Name Label, and the Titlebar.
            AlgorithmName         = _settings.AlgorithmName;
            lblAlgorithmName.Text = _settings.AlgorithmName;
            this.Text             = $"{_settings.AlgorithmName} Settings";

            //Create the Controls on each of the Dynamic Flow Panels.
            BuildSettingsPanel(_settings.ActiveSettings, flpActive, SettingInstanceType.Active);
            BuildSettingsPanel(_settings.DeadSettings, flpDead, SettingInstanceType.Dead);
            BuildSettingsPanel(_settings.GlobalSettings, flpGlobal, SettingInstanceType.Global);

            //Set Visibility for all Settings based on current values.
            SetAllVisibility();

            //Show the form.
            this.Show();
        }