예제 #1
0
        private void BtnEnumMappings_Click(object sender, EventArgs e)
        {
            var dialog = new AttributesToEnumMapperDialog(this)
            {
                ConfigValue = Settings.ExtensionConfig.PropertyEnumMappings
            };
            var result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                Settings.ExtensionConfig.PropertyEnumMappings = dialog.ConfigValue;
                SaveSettings();
            }
        }
예제 #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var set = (List <string>)value ?? new List <string>();

            if (!(context?.Instance is IGetPluginControl getter))
            {
                throw new InvalidOperationException("Context Instance did not implement IGetPluginControl.  Unable to determine plugin to connect with.");
            }
            using (var dialog = new AttributesToEnumMapperDialog(getter.GetPluginControl())
            {
                CsvLines = set
            })
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    set = dialog.CsvLines;
                }
            }
            return(set); // can also replace the wrapper object here
        }
 private void BtnEnumMappings_Click(object sender, EventArgs e)
 {
     var dialog = new AttributesToEnumMapperDialog(this) { ConfigValue = Settings.ExtensionConfig.PropertyEnumMappings };
     var result = dialog.ShowDialog();
     if (result == DialogResult.OK)
     {
         Settings.ExtensionConfig.PropertyEnumMappings = dialog.ConfigValue;
         Settings.Save();
     }
 }