public PluginController(IPluginFinder pluginFinder,
            ILocalizationService localizationService,
			IWebHelper webHelper,
            IPermissionService permissionService,
			ILanguageService languageService,
            ISettingService settingService,
			IStoreService storeService,
            PaymentSettings paymentSettings,
			ShippingSettings shippingSettings,
            TaxSettings taxSettings, 
			ExternalAuthenticationSettings externalAuthenticationSettings, 
            WidgetSettings widgetSettings)
		{
            this._pluginFinder = pluginFinder;
            this._localizationService = localizationService;
            this._webHelper = webHelper;
            this._permissionService = permissionService;
            this._languageService = languageService;
            this._settingService = settingService;
			this._storeService = storeService;
            this._paymentSettings = paymentSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
            this._widgetSettings = widgetSettings;
		}
        public PluginController(IPluginFinder pluginFinder,
            IPermissionService permissionService,
			ILanguageService languageService,
            PaymentSettings paymentSettings,
			ShippingSettings shippingSettings,
            TaxSettings taxSettings, 
			ExternalAuthenticationSettings externalAuthenticationSettings, 
            WidgetSettings widgetSettings,
			IProviderManager providerManager,
			PluginMediator pluginMediator,
			ICommonServices commonService)
		{
            this._pluginFinder = pluginFinder;
            this._permissionService = permissionService;
            this._languageService = languageService;
            this._paymentSettings = paymentSettings;
            this._shippingSettings = shippingSettings;
            this._taxSettings = taxSettings;
            this._externalAuthenticationSettings = externalAuthenticationSettings;
            this._widgetSettings = widgetSettings;
			this._providerManager = providerManager;
			this._pluginMediator = pluginMediator;
			this._commonService = commonService;

			T = NullLocalizer.Instance;
		}
        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;
		}
		public static bool IsWidgetActive(this Lazy<IWidget, ProviderMetadata> widget, WidgetSettings widgetSettings)
		{
			Guard.ArgumentNotNull(() => widget);
			Guard.ArgumentNotNull(() => widgetSettings);

			if (widgetSettings.ActiveWidgetSystemNames == null)
			{
				return false;
			}

			return widgetSettings.ActiveWidgetSystemNames.Contains(widget.Metadata.SystemName, StringComparer.OrdinalIgnoreCase);
		}
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="pluginFinder">Plugin finder</param>
        /// <param name="widgetSettings">Widget settings</param>
		/// <param name="pluginService">Plugin service</param>
		public WidgetService(
			IPluginFinder pluginFinder, 
			WidgetSettings widgetSettings, 
			ISettingService settingService, 
			IProviderManager providerManager,
			ICacheManager cacheManager)
        {
            this._pluginFinder = pluginFinder;
            this._widgetSettings = widgetSettings;
			this._settingService = settingService;
			this._providerManager = providerManager;
			this._cacheManager = cacheManager;
        }
        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;
        }
		private readonly ISettingService _settingService;	// codehint: sm-add

        #endregion
        
        #region Ctor

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="pluginFinder">Plugin finder</param>
        /// <param name="widgetSettings">Widget settings</param>
		/// <param name="pluginService">Plugin service</param>
		public WidgetService(IPluginFinder pluginFinder, WidgetSettings widgetSettings, ISettingService settingService)
        {
            this._pluginFinder = pluginFinder;
            this._widgetSettings = widgetSettings;
			this._settingService = settingService;	// codehint: sm-add
        }
        public static bool IsWidgetActive(this Provider<IWidget> widget, WidgetSettings widgetSettings)
        {
			Guard.ArgumentNotNull(() => widget);

			return widget.ToLazy().IsWidgetActive(widgetSettings);
        }