예제 #1
0
 public WidgetController(IWidgetService widgetService,
     IPermissionService permissionService, ISettingService settingService,
     WidgetSettings widgetSettings, IPluginFinder pluginFinder)
 {
     this._widgetService = widgetService;
     this._permissionService = permissionService;
     this._settingService = settingService;
     this._widgetSettings = widgetSettings;
     this._pluginFinder = pluginFinder;
 }
예제 #2
0
        public static bool IsWidgetActive(this IWidgetPlugin widget,
            WidgetSettings widgetSettings)
        {
            if (widget == null)
                throw new ArgumentNullException("widget");

            if (widgetSettings == null)
                throw new ArgumentNullException("widgetSettings");

            if (widgetSettings.ActiveWidgetSystemNames == null)
                return false;
            foreach (string activeMethodSystemName in widgetSettings.ActiveWidgetSystemNames)
                if (widget.PluginDescriptor.SystemName.Equals(activeMethodSystemName, StringComparison.InvariantCultureIgnoreCase))
                    return true;
            return false;
        }
예제 #3
0
 public PluginController(IPluginFinder pluginFinder,
     ILocalizationService localizationService,
     IWebHelper webHelper,
     IPermissionService permissionService,
     ILanguageService languageService,
     ISettingService settingService,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     WidgetSettings widgetSettings)
 {
     this._pluginFinder = pluginFinder;
     this._localizationService = localizationService;
     this._webHelper = webHelper;
     this._permissionService = permissionService;
     this._languageService = languageService;
     this._settingService = settingService;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._widgetSettings = widgetSettings;
 }
예제 #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="pluginFinder">Plugin finder</param>
 /// <param name="widgetSettings">Widget settings</param>
 public WidgetService(IPluginFinder pluginFinder,
     WidgetSettings widgetSettings)
 {
     this._pluginFinder = pluginFinder;
     this._widgetSettings = widgetSettings;
 }