public void Initialize() { _utilities = Telligent.Evolution.Extensibility.Version1.PluginManager.GetSingleton <IThemeUtilities>(); if (_utilities == null || !_utilities.EnableThemePageControls) { return; } ContentFragmentPageService = Services.Get <IContentFragmentPageService>(); ContentFragmentScopedPropertyService = Services.Get <IContentFragmentScopedPropertyService>(); ThemeTypeService = Services.Get <IThemeTypeService>(); _userThemeTypeId = CSContext.Current.SiteSettings.UserThemeTypeID; _siteThemeTypeId = SiteThemeContext.Instance().ThemeTypeID; _groupThemeTypeId = CSContext.Current.SiteSettings.GroupThemeTypeID; _blogThemeTypeId = CSContext.Current.SiteSettings.BlogThemeTypeID; _themeContextId = Guid.Empty; _siteThemeName = CSContext.Current.SiteTheme; _themeConfigurationData = ThemeConfigurationDatas.GetThemeConfigurationData(_siteThemeTypeId, _themeContextId, _siteThemeName, false); _themeFileFolders = new List <string> { Constants.ThemeStylesheetFiles, Constants.ThemePrintStylesheetFiles, Constants.ThemeJavascriptFiles, Constants.ThemeGeneralFiles }; }
public ConnectionManagerControl(IServiceContainer services) { InitializeComponent(); _theme = services.GetService <IThemeUtilities>(); var ui = services.UI(); ui.UIThemeChanged += OnUIThemeChanged; SetImageBackground(); }
public ContainerManagerControl(IServiceContainer services) { InitializeComponent(); _services = services; _theme = services.GetService <IThemeUtilities>(); var ui = services.UI(); ui.UIThemeChanged += OnThemeChanged; SetImageBackground(); ViewModel = new ContainerManagerViewModel(services); DataContext = ViewModel; }
public ConnectionManagerControl(IServiceContainer services) { InitializeComponent(); _theme = services.GetService <IThemeUtilities>(); var ui = services.UI(); ui.UIThemeChanged += OnThemeChanged; SetImageBackground(); ViewModel = new ConnectionManagerViewModel(services); _disposable .Add(ViewModel) .Add(() => ui.UIThemeChanged -= OnThemeChanged); DataContext = ViewModel; }
public void Initialize() { IThemeUtilities utilites = Telligent.Evolution.Extensibility.Version1.PluginManager.GetSingleton <IThemeUtilities>(); if (utilites == null || !utilites.EnableSourceMap) { return; } _siteThemeTypeId = SiteThemeContext.Instance().ThemeTypeID; _themeContextId = Guid.Empty; _siteThemeName = CSContext.Current.SiteTheme; CentralizedFileStorage.Events.AfterCreate += AfterCreateStylesheet; CentralizedFileStorage.Events.AfterUpdate += AfterUpdateStylesheet; }
public void Register(IRestEndpointController restRoutes) { IThemeUtilities utilites = PluginManager.GetSingleton <IThemeUtilities>(); if (utilites == null || !utilites.EnableThemePageControls) { return; } restRoutes.Add(2, "themeutility/reset", HttpMethod.Post, request => { var response = new RestResponse(); try { string action = request.Request.QueryString["action"]; if (string.IsNullOrEmpty(action)) { throw new ArgumentException("Action parameter is required ('theme' or 'cache')."); } ThemeUtility themeUtility = PluginManager.GetSingleton <ThemeUtility>(); if (themeUtility != null) { if (action.Equals("theme", StringComparison.OrdinalIgnoreCase)) { themeUtility.RevertTheme(); } if (action.Equals("cache", StringComparison.OrdinalIgnoreCase)) { themeUtility.ResetCache(); } } } catch (Exception ex) { response.Errors = new [] { ex.Message }; } return(response); }); }
public void Initialize() { ThemeUtility themeUtility = PluginManager.GetSingleton <ThemeUtility>(); IThemeUtilities utilites = PluginManager.GetSingleton <IThemeUtilities>(); if (themeUtility == null || utilites == null || !utilites.EnableFileSystemWatcher) { return; } _siteThemeName = CSContext.Current.SiteTheme; InitialiseFileSystemWatcher(Constants.DefaultWidgets, themeUtility.ResetCache); InitialiseFileSystemWatcher(Constants.FactoryDefaultConfigurations, () => themeUtility.RevertTheme(ReversionType.Configuration), _siteThemeName); InitialiseFileSystemWatcher(Constants.FactoryDefaultPages, () => themeUtility.RevertTheme(ReversionType.Layouts), _siteThemeName); InitialiseFileSystemWatcher(Constants.ThemeFiles, () => themeUtility.RevertTheme(ReversionType.Files), string.Format(@"s\fd\{0}", _siteThemeName)); }
public void Initialize() { _utilities = Telligent.Evolution.Extensibility.Version1.PluginManager.GetSingleton<IThemeUtilities>(); if (_utilities == null || !_utilities.EnableThemePageControls) return; ContentFragmentPageService = Services.Get<IContentFragmentPageService>(); ContentFragmentScopedPropertyService = Services.Get<IContentFragmentScopedPropertyService>(); ThemeTypeService = Services.Get<IThemeTypeService>(); _userThemeTypeId = CSContext.Current.SiteSettings.UserThemeTypeID; _siteThemeTypeId = SiteThemeContext.Instance().ThemeTypeID; _groupThemeTypeId = CSContext.Current.SiteSettings.GroupThemeTypeID; _blogThemeTypeId = CSContext.Current.SiteSettings.BlogThemeTypeID; _themeContextId = Guid.Empty; _siteThemeName = CSContext.Current.SiteTheme; _themeConfigurationData = ThemeConfigurationDatas.GetThemeConfigurationData(_siteThemeTypeId, _themeContextId, _siteThemeName, false); _themeFileFolders = new List<string> { Constants.ThemeStylesheetFiles, Constants.ThemePrintStylesheetFiles, Constants.ThemeJavascriptFiles, Constants.ThemeGeneralFiles }; }