Пример #1
0
        partial void OnPluginGuidChanged()
        {
            if (!this.IsNotifying)
            {
                return;
            }
            this.PluginGeneratorGuid = string.Empty;
            this.GenFileName         = string.Empty;
            UpdateListGenerators();
            if (cfg.IsInitialized)
            {
                var nv = new ModelVisitorNodeGenSettings();
                nv.NodeGenSettingsApplyAction(this.GetConfig(), (p) =>
                {
                    p.RemoveNodeAppGenSettings(this.Guid);
                });
            }
            //this.NotifyPropertyChanged(() => this.DynamicNodesSettings);
            if (!string.IsNullOrWhiteSpace(this.GenFileName))
            {
                prevGenFileName = this.GenFileName;
            }
            this.GenFileName = string.Empty;
            if (!string.IsNullOrWhiteSpace(this.RelativePathToGenFolder))
            {
                prevRelativePathToGenFolder = this.RelativePathToGenFolder;
            }
            this.RelativePathToGenFolder = string.Empty;

            // adding new plugins group settings
            var sln = (AppSolution)this.Parent.Parent;

            if (!string.IsNullOrWhiteSpace(this.PluginGuid))
            {
                this.plugin = cfg.DicPlugins[this.PluginGuid];
                this.Name   = this.plugin.Name;
                var groupSettings = this.plugin.GetPluginGroupSolutionSettingsVmFromJson(null);
                if (groupSettings != null)
                {
                    this.PluginGroupSettingsGuid = groupSettings.Guid;
                    if (!sln.DicPluginsGroupSettings.ContainsKey(groupSettings.Guid))
                    {
                        sln.DicPluginsGroupSettings[groupSettings.Guid] = groupSettings;
                    }
                }
            }
            HideProperties();
            sln.DynamicPluginGroupSettings  = null;
            this.DynamicGeneratorSettings   = null;
            this.DynamicMainConnStrSettings = null;
            this.DynamicModelNodeSettings   = null;
            // auto selection generator if it is only one
            if (this.ListGenerators.Count == 1)
            {
                this.PluginGeneratorGuid = this.ListGenerators[0].Guid;
            }
        }
Пример #2
0
 public Plugin(ITreeConfigNode parent, IvPlugin plugin)
     : this(parent)
 {
     Contract.Requires(plugin != null);
     this.Guid        = plugin.Guid.ToString();
     this._Name       = plugin.Name;
     this.Description = plugin.Description;
     this.VPlugin     = plugin;
     this.IsEditable  = false;
 }
Пример #3
0
 public void SetVPlugin(IvPlugin plugin)
 {
     this.VPlugin = plugin;
 }