Exemplo n.º 1
0
        private void BtnSpecifyAttributeNames_Click(object sender, EventArgs e)
        {
            var dialog = new SpecifyAttributeNamesDialog(this)
            {
                ConfigValue = Settings.ExtensionConfig.EntityAttributeSpecifiedNames
            };
            var result = dialog.ShowDialog();

            if (result != DialogResult.OK)
            {
                return;
            }
            Settings.ExtensionConfig.EntityAttributeSpecifiedNames = dialog.ConfigValue;
            SaveSettings();
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            var set = (Dictionary <string, HashSet <string> >)value ?? new Dictionary <string, HashSet <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 SpecifyAttributeNamesDialog(getter.GetPluginControl())
            {
                AttributesByEntity = set
            })
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    set = dialog.AttributesByEntity;
                }
            }
            return(set); // can also replace the wrapper object here
        }
 private void BtnSpecifyAttributeNames_Click(object sender, EventArgs e)
 {
     var dialog = new SpecifyAttributeNamesDialog(this) {
         ConfigValue = Settings.ExtensionConfig.EntityAttributeSpecifiedNames
     };
     var result = dialog.ShowDialog();
     if (result != DialogResult.OK) return;
     Settings.ExtensionConfig.EntityAttributeSpecifiedNames = dialog.ConfigValue;
     Settings.Save();
 }