protected void InitializeBadEggPluginManager() { lock (_testPluginBadEgg) { while (_pluginLoadedBadEgg.HasValue && !_pluginLoadedBadEgg.Value) { System.Threading.Thread.Sleep(30); } if (_pluginLoadedBadEgg.HasValue && _pluginLoadedBadEgg.Value) { return; } if (_pluginLoadedBadEgg == null) { _pluginLoadedBadEgg = false; } _testPluginBadEgg.AddAssembly(Assembly.GetExecutingAssembly()); _testPluginBadEgg.UsePlugin(typeof(DemoWebsite.Classes.PluginInitialisation)); _testPluginBadEgg.UsePlugin(typeof(MemoryCache.Plugin.PluginInitialisation)); _testPluginBadEgg.UsePlugin(typeof(ProductPlugin.PluginInitialisation)); _testPluginBadEgg.UsePlugin(typeof(SearchPlugin.PluginInitialisation)); _testPluginBadEgg.UsePlugin(typeof(BadEgg.Plugin.PluginInitialisation)); _testPluginBadEgg.ConfigureServices(); _pluginServicesBadEgg = new pm.PluginServices(_testPluginBadEgg) as IPluginClassesService; _pluginLoadedBadEgg = true; } Assert.IsNotNull(_pluginServicesBadEgg); }
protected void InitializeSmokeTestPluginManager() { lock (_testPluginSmokeTest) { while (_pluginLoadedSmokeTest.HasValue && !_pluginLoadedSmokeTest.Value) { System.Threading.Thread.Sleep(30); } if (_pluginLoadedSmokeTest.HasValue && _pluginLoadedSmokeTest.Value) { return; } if (_pluginLoadedSmokeTest == null) { _pluginLoadedSmokeTest = false; } _testPluginSmokeTest.AddAssembly(Assembly.GetExecutingAssembly()); _testPluginSmokeTest.UsePlugin(typeof(LoginPlugin.PluginInitialisation)); _testPluginSmokeTest.ConfigureServices(); _pluginServicesSmokeTest = new pm.PluginServices(_testPluginSmokeTest) as IPluginClassesService; _pluginLoadedSmokeTest = true; } Assert.IsNotNull(_pluginServicesSmokeTest); }
protected void InitializeLoginPluginManager() { lock (_testPluginLogin) { while (_pluginLoadedLogin.HasValue && !_pluginLoadedLogin.Value) { System.Threading.Thread.Sleep(30); } if (_pluginLoadedLogin.HasValue && _pluginLoadedLogin.Value) { return; } if (_pluginLoadedLogin == null) { _pluginLoadedLogin = false; } _testPluginLogin.AddAssembly(Assembly.GetExecutingAssembly()); _testPluginLogin.UsePlugin(typeof(DemoWebsite.Classes.PluginInitialisation)); _testPluginLogin.UsePlugin(typeof(MemoryCache.Plugin.PluginInitialisation)); _testPluginLogin.UsePlugin(typeof(LoginPlugin.PluginInitialisation)); _testPluginLogin.ConfigureServices(); _pluginServicesLogin = new pm.PluginServices(_testPluginLogin) as IPluginClassesService; _pluginLoadedLogin = true; } Assert.IsNotNull(_pluginServicesLogin); }
public BreadcrumbMiddleware(RequestDelegate next, IActionDescriptorCollectionProvider routeProvider, IRouteDataService routeDataService, IPluginHelperService pluginHelperService, IPluginTypesService pluginTypesService, ISettingsProvider settingsProvider, IPluginClassesService pluginClassesService, ILogger logger) { if (routeProvider == null) { throw new ArgumentNullException(nameof(routeProvider)); } if (routeDataService == null) { throw new ArgumentNullException(nameof(routeDataService)); } if (pluginHelperService == null) { throw new ArgumentNullException(nameof(pluginHelperService)); } if (pluginClassesService == null) { throw new ArgumentNullException(nameof(pluginClassesService)); } if (pluginTypesService == null) { throw new ArgumentNullException(nameof(pluginTypesService)); } if (settingsProvider == null) { throw new ArgumentNullException(nameof(settingsProvider)); } _next = next; _logger = logger ?? throw new ArgumentNullException(nameof(logger)); if (pluginHelperService.PluginLoaded(Constants.PluginNameLocalization, out int _)) { List <IStringLocalizer> stringLocalizers = pluginClassesService.GetPluginClasses <IStringLocalizer>(); if (stringLocalizers.Count > 0) { _stringLocalizer = stringLocalizers[0]; } } BreadcrumbSettings settings = settingsProvider.GetSettings <BreadcrumbSettings>(Constants.PluginSettingBreadcrumb); _homeBreadCrumb = new BreadcrumbItem(settings.HomeName, $"{Constants.ForwardSlash}{settings.HomeController}{Constants.ForwardSlash}{settings.DefaultAction}", false); LoadBreadcrumbData(routeProvider, routeDataService, pluginTypesService, settings); if (!String.IsNullOrEmpty(settings.StaticFileExtensions)) { _staticFileExtensions = settings.StaticFileExtensions; } }
protected void InitializeDocumentationPluginManager() { lock (_testPluginDocs) { while (_pluginLoadedDocs.HasValue && !_pluginLoadedDocs.Value) { System.Threading.Thread.Sleep(30); } if (_pluginLoadedDocs.HasValue && _pluginLoadedDocs.Value) { return; } if (_pluginLoadedDocs == null) { _pluginLoadedDocs = false; } _testPluginDocs.AddAssembly(Assembly.GetExecutingAssembly()); _testPluginDocs.UsePlugin(typeof(DemoWebsite.Classes.PluginInitialisation)); _testPluginDocs.UsePlugin(typeof(DocumentationPlugin.PluginInitialisation)); _testPluginDocs.UsePlugin(typeof(MemoryCache.Plugin.PluginInitialisation)); _testPluginDocs.UsePlugin(typeof(ProductPlugin.PluginInitialisation)); _testPluginDocs.UsePlugin(typeof(SearchPlugin.PluginInitialisation)); _testPluginDocs.UsePlugin(typeof(BadEgg.Plugin.PluginInitialisation)); _testPluginDocs.ConfigureServices(); _pluginServicesDocs = new pm.PluginServices(_testPluginDocs) as IPluginClassesService; TimeSpan docLoadTime = new TimeSpan(0, 0, 30); DateTime startLoadDocs = DateTime.Now; while (Shared.Classes.ThreadManager.Exists(SharedPluginFeatures.Constants.DocumentationLoadThread)) { System.Threading.Thread.Sleep(100); if (DateTime.Now - startLoadDocs > docLoadTime) { break; } } Assert.IsFalse(Shared.Classes.ThreadManager.Exists(Constants.DocumentationLoadThread)); _documentationService = (IDocumentationService)_testPluginDocs.GetServiceProvider() .GetService(typeof(IDocumentationService)); Assert.IsNotNull(_documentationService); Assert.IsTrue(_documentationService.GetDocuments().Count > 100); _pluginLoadedDocs = true; } Assert.IsNotNull(_pluginServicesDocs); }
public CartController(IShoppingCartProvider shoppingCartProvider, IAccountProvider accountProvider, IPluginClassesService pluginClassesService, IStockProvider stockProvider, IApplicationProvider applicationProvider) { _applicationProvider = applicationProvider ?? throw new ArgumentNullException(nameof(applicationProvider)); _shoppingCartProvider = shoppingCartProvider ?? throw new ArgumentNullException(nameof(shoppingCartProvider)); _accountProvider = accountProvider ?? throw new ArgumentNullException(nameof(accountProvider)); _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); _stockProvider = stockProvider ?? throw new ArgumentNullException(nameof(stockProvider)); }
internal static void InitSessionHelper() { UserSessionManager.Instance.OnSessionCreated += UserSession_OnSessionCreated; UserSessionManager.Instance.OnSavePage += UserSession_OnSavePage; UserSessionManager.Instance.OnSessionClosing += UserSession_OnSessionClosing; UserSessionManager.Instance.OnSessionRetrieve += UserSession_OnSessionRetrieve; UserSessionManager.Instance.OnSessionSave += UserSession_OnSessionSave; UserSessionManager.Instance.IPAddressDetails += UserSession_IPAddressDetails; _pluginClasses = Initialisation.GetServiceProvider.GetRequiredService <IPluginClassesService>(); }
internal static void InitSessionHelper(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); UserSessionManager.Instance.OnSessionCreated += UserSession_OnSessionCreated; UserSessionManager.Instance.OnSavePage += UserSession_OnSavePage; UserSessionManager.Instance.OnSessionClosing += UserSession_OnSessionClosing; UserSessionManager.Instance.OnSessionRetrieve += UserSession_OnSessionRetrieve; UserSessionManager.Instance.OnSessionSave += UserSession_OnSessionSave; UserSessionManager.Instance.IPAddressDetails += UserSession_IPAddressDetails; _pluginClasses = _serviceProvider.GetRequiredService <IPluginClassesService>(); }
public SitemapMiddleware(RequestDelegate next, IPluginClassesService pluginClassesService, IMemoryCache memoryCache, INotificationService notificationService) { if (notificationService == null) { throw new ArgumentNullException(nameof(notificationService)); } _next = next; _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache)); notificationService.RegisterListener(this); }
public SharedPluginHelper(IMemoryCache memoryCache, IPluginClassesService pluginClassesService) { _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache)); _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); }
public MockClaimsProvider(IPluginClassesService pluginClassesService) { _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); _claimsForUser = new List <string>(); }
public SystemAdminHelper(IMemoryCache memoryCache, IPluginClassesService pluginClassesService, IBreadcrumbService breadcrumbService) { _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache)); _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); }
//private static readonly object _lockObject = new object(); #endregion Private Members #region Constructors /// <summary> /// Constructor /// </summary> /// <param name="pluginClassesService">IPluginClassesService instance</param> public DefaultSearchProvider(IPluginClassesService pluginClassesService) { _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); _searchProviders = _pluginClassesService.GetPluginClasses <ISearchKeywordProvider>(); }
public AllTimings(IPluginClassesService pluginClassesService, ISystemAdminHelperService systemAdminHelperService) { _pluginClassesService = pluginClassesService ?? throw new ArgumentNullException(nameof(pluginClassesService)); _systemAdminHelperService = systemAdminHelperService ?? throw new ArgumentNullException(nameof(systemAdminHelperService)); }