Beispiel #1
0
        private void UpdateProperties(ParameterBuilder parameterBuilder, ExtensionTypeParameter[] parameters, GroupBox groupBox)
        {
            parameterBuilder.Reset();
            if (!(parameters?.Any() ?? false))
            {
                return;
            }

            parameterBuilder.AddParameters(parameters);

            foreach (var parameter in parameters)
            {
                var parameterControl = groupBox.Controls.Find(parameter.Name, false)[0];

                switch (parameterControl)
                {
                case TextBox textBox:
                    textBox.TextChanged += (sender, args) => LoadImage(false);
                    break;

                case CheckBox checkBox:
                    checkBox.CheckedChanged += (sender, args) => LoadImage(false);
                    break;

                case ComboBox comboBox:
                    comboBox.SelectedIndexChanged += (sender, args) => LoadImage(false);
                    break;
                }
            }
        }