Beispiel #1
0
        /// <inheritdoc />
        public override void OnDialogOpened(IDialogParameters parameters)
        {
            var title = parameters.GetValue <string>(LoadedPluginsDialogParameterNames.Title);

            if (title != null)
            {
                Title = title;
            }
            var loadedPlugins = parameters.GetValue <IEnumerable <PluginViewModel> >(LoadedPluginsDialogParameterNames.LoadedPlugins);

            if (loadedPlugins != null)
            {
                LoadedPlugins.Clear();
                LoadedPlugins.AddRange(loadedPlugins);
            }
        }
Beispiel #2
0
        public bool LoadPlugins()
        {
            LoadedPlugins.Clear();
            foreach (string name in m_PluginNames)
            {
                IPlugin plugin = null;

                try
                {
                    plugin = (IPlugin)Activator.CreateInstance(Type.GetType(name));
                }
                catch (Exception)
                {
                    return(false);
                }

                if (plugin != null)
                {
                    LoadedPlugins.Add(plugin);
                }
            }

            return(true);
        }