/// <summary>
        /// Creates a new Linux code color collection instance.
        /// </summary>
        public LinuxCodeColorCollection()
        {
            // Set the theme color table.
            this.themeSettings = ToolStripManager.Renderer is ThemeRenderer ? (ToolStripManager.Renderer as ThemeRenderer).Settings : ThemeSettings.Default;
            this.colorTable = this.themeSettings.ColorTable.CodeColorTable;

            // Add the Linux tokens.

            this.Add(new Token { Regex = "#+.*$", ForegroundColor = this.colorTable.CommentForeground, BackgroundColor = this.colorTable.CommentBackground }); // Comment
            this.Add(new Token { Regex = "\"[^\"]+\"", ForegroundColor = this.colorTable.StringForeground, BackgroundColor = this.colorTable.StringBackground }); // String

            foreach (string keyword in LinuxCodeColorCollection.keywords) // Keywords
            {
                this.Add(new Token { Regex = @"\b{0}\b".FormatWith(keyword), ForegroundColor = this.colorTable.KeywordForeground, BackgroundColor = this.colorTable.KeywordBackground });
            }
        }
        public PageAssetsBuilder(
            SeoSettings seoSettings,
            ThemeSettings themeSettings,
            HttpContextBase httpContext,
            IStoreContext storeContext,
            IBundleBuilder bundleBuilder)
        {
            _httpContext   = httpContext;
            _seoSettings   = seoSettings;
            _themeSettings = themeSettings;
            _bundleBuilder = bundleBuilder;

            var bodyHtmlId = storeContext.CurrentStore.HtmlBodyId;

            if (bodyHtmlId.HasValue())
            {
                BodyAttributes["id"] = bodyHtmlId;
            }
        }
Esempio n. 3
0
        public DefaultAssetCache(
            ThemeSettings themeSettings,
            IApplicationEnvironment env,
            IThemeFileResolver themeFileResolver,
            IThemeContext themeContext,
            IThemeRegistry themeRegistry,
            ICommonServices services)
        {
            _themeSettings = themeSettings;
            _isEnabled     = _themeSettings.AssetCachingEnabled == 2 || (_themeSettings.AssetCachingEnabled == 0 && !HttpContext.Current.IsDebuggingEnabled);

            _env               = env;
            _themeContext      = themeContext;
            _themeFileResolver = themeFileResolver;
            _themeRegistry     = themeRegistry;
            _services          = services;

            Logger = NullLogger.Instance;
        }
Esempio n. 4
0
 void OnMainWindowClosed(object sender, FormClosedEventArgs e)
 {
     lock (shutdownLock) {
         if (shutdown)
         {
             return;
         }
         shutdown = true;
     }
     Cef.Shutdown();
     logger.Flush();
     logger.Dispose();
     Playlist.Terminate();
     UiSettings.Terminate();
     AppSettings.Terminate();
     ThemeSettings.Terminate();
     DownloadQueue.Terminate();
     PostProcessingQueue.Terminate();
 }
Esempio n. 5
0
 public PageAssetsBuilder(
     SeoSettings seoSettings,
     ThemeSettings themeSettings,
     HttpContextBase httpContext,
     IStoreContext storeContext,
     IBundleBuilder bundleBuilder)
 {
     this._httpContext          = httpContext; // codehint: sm-add
     this._seoSettings          = seoSettings;
     this._themeSettings        = themeSettings;
     this._titleParts           = new List <string>();
     this._metaDescriptionParts = new List <string>();
     this._metaKeywordParts     = new List <string>();
     this._scriptParts          = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._cssParts             = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._canonicalUrlParts    = new List <string>();
     this._bodyCssClasses       = new List <string>(); // codehint: sm-add (MC)
     this._storeContext         = storeContext;        // codehint: sm-add
     this._bundleBuilder        = bundleBuilder;
 }
Esempio n. 6
0
        public async Task <ThemeSettings> GetThemeSettings(string theme)
        {
            var settings = new ThemeSettings();
            var fileName = Path.Combine(ContentRoot, $"wwwroot{_slash}themes{_slash}{theme.ToLower()}{_slash}settings.json");

            if (File.Exists(fileName))
            {
                try
                {
                    string jsonString = File.ReadAllText(fileName);
                    settings = JsonSerializer.Deserialize <ThemeSettings>(jsonString);
                }
                catch (Exception ex)
                {
                    Serilog.Log.Error($"Error reading theme settings: {ex.Message}");
                    return(null);
                }
            }

            return(await Task.FromResult(settings));
        }
Esempio n. 7
0
        public App()
        {
            //base.\u002Ector();
            //this.InitializeTelemetry();
            Logger.Instance.Info("App() check 1");
            this.UnhandledException += (new EventHandler <ApplicationUnhandledExceptionEventArgs>(this.App_UnhandledException));
            this.InitializeComponent();
            Logger.Instance.Info("App() check 2");
            ThemeSettings themeSettings = ThemeSettingsManager.GetThemeSettings();

            Logger.Instance.Info("App() check 3");
            this.ApplyThemeBasedOnSettings(themeSettings);
            Logger.Instance.Info("App() check 4");
            this.InitializePhoneApplication();
            Logger.Instance.Info("App() check 5");
            this.InitializeLanguage(themeSettings);
            Logger.Instance.Info("App() check 6");
            this.InitializeServiceLocator();
            Logger.Instance.Info("App() check 7");
            IPageDataRequesteeInfo pageDataRequestee = PageBase.CurrentPageDataRequestee;
        }
        public void Update(ThemeSettings data)
        {
            if (String.IsNullOrWhiteSpace(data.BootstrapCssUri))
            {
                _bootstrapUri = "/vendor/bootstrap4/css/bootstrap.css?v=" + DateTime.Now.Ticks;
            }
            else
            {
                _bootstrapUri = data.BootstrapCssUri;
            }


            if (String.IsNullOrWhiteSpace(data.CreativeStartCssUri))
            {
                _creativeStartUri = "/vendor/bootstrap4-creativestart/creative.css?v=" + DateTime.Now.Ticks;
            }
            else
            {
                _creativeStartUri = data.CreativeStartCssUri;
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Creates the list of theme instances based on all the theme settings
        /// </summary>
        protected virtual void SetupThemes()
        {
            InteractableProfileItem.ThemeLists lists = InteractableProfileItem.GetThemeTypes();
            runningThemesList      = new List <InteractableThemeBase>();
            runningProfileSettings = new List <ProfileSettings>();
            for (int i = 0; i < Profiles.Count; i++)
            {
                ProfileSettings      profileSettings   = new ProfileSettings();
                List <ThemeSettings> themeSettingsList = new List <ThemeSettings>();
                for (int j = 0; j < Profiles[i].Themes.Count; j++)
                {
                    Theme         theme         = Profiles[i].Themes[j];
                    ThemeSettings themeSettings = new ThemeSettings();
                    if (Profiles[i].Target != null && theme != null)
                    {
                        List <InteractableThemePropertySettings> tempSettings = new List <InteractableThemePropertySettings>();
                        for (int n = 0; n < theme.Settings.Count; n++)
                        {
                            InteractableThemePropertySettings settings = theme.Settings[n];

                            settings.Theme = InteractableProfileItem.GetTheme(settings, Profiles[i].Target, lists);

                            // add themes to theme list based on dimension
                            if (j == dimensionIndex)
                            {
                                runningThemesList.Add(settings.Theme);
                            }

                            tempSettings.Add(settings);
                        }

                        themeSettings.Settings = tempSettings;
                        themeSettingsList.Add(themeSettings);
                    }
                }

                profileSettings.ThemeSettings = themeSettingsList;
                runningProfileSettings.Add(profileSettings);
            }
        }
Esempio n. 10
0
        public void Update(ThemeSettings data)
        {
            if (String.IsNullOrWhiteSpace(data.ThemeCssUri))
            {
                _themeUri = "/main/themes/default.css";
            }
            else
            {
                _themeUri = data.ThemeCssUri;
            }

            if (String.IsNullOrWhiteSpace(data.CustomThemeCssUri))
            {
                _customThemeUri = null;
            }
            else
            {
                _customThemeUri = data.CustomThemeCssUri;
            }

            if (String.IsNullOrWhiteSpace(data.BootstrapCssUri))
            {
                _bootstrapUri = "/main/bootstrap/bootstrap.css";
            }
            else
            {
                _bootstrapUri = data.BootstrapCssUri;
            }

            if (String.IsNullOrWhiteSpace(data.CreativeStartCssUri))
            {
                _creativeStartUri = "/main/bootstrap4-creativestart/creative.css";
            }
            else
            {
                _creativeStartUri = data.CreativeStartCssUri;
            }

            FirstRun = data.FirstRun;
        }
Esempio n. 11
0
 public PageAssetsBuilder(
     SeoSettings seoSettings,
     ThemeSettings themeSettings,
     HttpContextBase httpContext,
     ISiteContext storeContext,
     IBundleBuilder bundleBuilder)
 {
     this._httpContext          = httpContext;
     this._seoSettings          = seoSettings;
     this._themeSettings        = themeSettings;
     this._titleParts           = new List <string>();
     this._metaDescriptionParts = new List <string>();
     this._metaKeywordParts     = new List <string>();
     this._scriptParts          = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._cssParts             = new Dictionary <ResourceLocation, List <WebAssetDescriptor> >();
     this._canonicalUrlParts    = new List <string>();
     this._customHeadParts      = new List <string>();
     this._bodyCssClasses       = new List <string>();
     this._linkParts            = new List <RouteValueDictionary>();
     this._storeContext         = storeContext;
     this._bundleBuilder        = bundleBuilder;
 }
Esempio n. 12
0
 public void CopyFrom(Store store)
 {
     Id                       = store.Id;
     Name                     = store.Name;
     DeliveryRules            = store.DeliveryRules;
     DeliveryAreas            = store.DeliveryAreas;
     TimezoneIanaFormat       = store.TimezoneIanaFormat;
     QRTemplate               = store.QRTemplate;
     Website                  = store.Website;
     IntroImage               = store.IntroImage;
     ProfileImage             = store.ProfileImage;
     ChargeToRoom             = store.ChargeToRoom;
     ClosingStoreMessage      = store.ClosingStoreMessage;
     Company_Id               = store.Company_Id;
     ContactEmail             = store.ContactEmail;
     Logo                     = store.Logo;
     MobilePhone              = store.MobilePhone;
     OfficePhone              = store.OfficePhone;
     DisplayOrder             = store.DisplayOrder;
     OrderPreparationTime     = store.OrderPreparationTime;
     IsEnabled                = store.IsEnabled;
     IsHQ                     = store.IsHQ;
     IsInOperation            = store.IsInOperation;
     IsTest                   = store.IsTest;
     Location                 = store.Location;
     OperatingHours           = store.OperatingHours;
     MenuTimeSettings         = store.MenuTimeSettings;
     PaymentConfigEnvironment = store.PaymentConfigEnvironment;
     RegistrationNumber       = store.RegistrationNumber;
     StoreTitle               = store.StoreTitle;
     TimezoneCity             = store.TimezoneCity;
     PointsToDollarRatio      = store.PointsToDollarRatio;
     IsEarnPointsWhenRedeem   = store.IsEarnPointsWhenRedeem;
     EarningRules             = store.EarningRules;
     RedemptionRules          = store.RedemptionRules;
     PriceTriggers            = store.PriceTriggers;
     ThemeSettings            = store.ThemeSettings;
 }
Esempio n. 13
0
 private void TreeSettings_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     try
     {
         PanelSettings.Suspend();
         if (e.Node != null)
         {
             if (e.Node.Tag.GetType() == typeof(Theme))
             {
                 ThemeSettings settings = new ThemeSettings((Theme)e.Node.Tag);
                 PanelSettings.Controls.Clear();
                 settings.Dock = DockStyle.Fill;
                 PanelSettings.Controls.Add(settings);
                 settings.Visible = true;
             }
         }
     }
     catch { }
     finally
     {
         PanelSettings.Resume();
     }
 }
Esempio n. 14
0
    /// <summary>
    /// Loads the default theme from the program settings folder.
    /// </summary>
    /// <returns></returns>
    public static ThemeSettings LoadDefaultTheme()
    {
        ThemeSettings result;

        if (File.Exists(DefaultFileName))
        {
            try
            {
                result = new ThemeSettings(DefaultFileName);
                result.Load(DefaultFileName);
                return(result);
            }
            catch
            {
                result = DefaultThemeLight;
                result.GreyBackground = Color.FromArgb(240, 240, 240);
                return(result);
            }
        }

        result = DefaultThemeLight;
        result.GreyBackground = Color.FromArgb(240, 240, 240);
        return(result);
    }
Esempio n. 15
0
 private void InitializeLanguage(ThemeSettings settings)
 {
     try
     {
         string languageCultureString = settings.LanguageCultureString;
         if (languageCultureString != string.Empty)
         {
             Thread.CurrentThread.CurrentCulture       = new CultureInfo(languageCultureString);
             Thread.CurrentThread.CurrentUICulture     = new CultureInfo(languageCultureString);
             CultureInfo.DefaultThreadCurrentCulture   = (new CultureInfo(languageCultureString));
             CultureInfo.DefaultThreadCurrentUICulture = (new CultureInfo(languageCultureString));
         }
         AppliedSettingsInfo.AppliedLanguageSetting = settings.LanguageSettings;
     }
     catch (Exception ex)
     {
         Logger.Instance.Error("App.InitializeLanguage failed", ex);
         if (Debugger.IsAttached)
         {
             Debugger.Break();
         }
         throw;
     }
 }
Esempio n. 16
0
        protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest manifest, ThemeSettings themeSettings)
        {
            var model = new ThemeManifestModel
            {
                Name            = manifest.ThemeName,
                BaseTheme       = manifest.BaseThemeName,
                Title           = manifest.ThemeTitle,
                Description     = manifest.PreviewText,
                Author          = manifest.Author,
                Url             = manifest.Url,
                Version         = manifest.Version,
                IsMobileTheme   = manifest.MobileTheme,
                SupportsRtl     = manifest.SupportRtl,
                PreviewImageUrl = manifest.PreviewImageUrl.HasValue() ? manifest.PreviewImageUrl : "{0}/{1}/preview.png".FormatInvariant(manifest.Location, manifest.ThemeName),
                IsActive        = manifest.MobileTheme ? themeSettings.DefaultMobileTheme == manifest.ThemeName : themeSettings.DefaultDesktopTheme == manifest.ThemeName,
                State           = manifest.State
            };

            if (HostingEnvironment.VirtualPathProvider.FileExists("{0}/{1}/Views/Shared/ConfigureTheme.cshtml".FormatInvariant(manifest.Location, manifest.ThemeName)))
            {
                model.IsConfigurable = true;
            }

            return(model);
        }
 public StoreThemeSelectorViewComponent(IThemeRegistry themeRegistry, ThemeSettings themeSettings, IThemeContext themeContext)
 {
     _themeRegistry = themeRegistry;
     _themeSettings = themeSettings;
     _themeContext  = themeContext;
 }
Esempio n. 18
0
 public static ThemeSettings ToEntity(this ThemeListModel model, ThemeSettings destination)
 {
     return(Mapper.Map(model, destination));
 }
Esempio n. 19
0
 public static ThemeListModel ToModel(this ThemeSettings entity)
 {
     return(Mapper.Map <ThemeSettings, ThemeListModel>(entity));
 }
Esempio n. 20
0
        private void SetTheme()
        {
            int theme = CrossSettings.Current.GetValueOrDefault(ThemeSettings.ThemeSetting, 0);

            ThemeSettings.SetTheme(theme == 0 ? ThemeSettings.Theme.Light : ThemeSettings.Theme.Dark);
        }
 public async Task<IActionResult> Theme(ThemeSettings settings)
 {
     await _SettingsRepository.UpdateSetting(settings);
     TempData["StatusMessage"] = "Theme settings updated successfully";
     return View(settings);
 }
Esempio n. 22
0
 private static string GetSoundUri(ThemeSettings themeSettings, string source) => source switch
 {
Esempio n. 23
0
 public async Task <bool> SaveThemeSettings(string theme, ThemeSettings settings)
 {
     return(await _storageProvider.SaveThemeSettings(theme, settings));
 }
Esempio n. 24
0
 public static ThemeSettings ToEntity(this ThemeListModel model, ThemeSettings entity)
 {
     MapperFactory.Map(model, entity);
     return(entity);
 }
Esempio n. 25
0
 public static void SetRequestedTheme(ThemeSettings selectedSetting) =>
 _settings.Values[keyTheme] = (int)selectedSetting;
Esempio n. 26
0
 public override string ToString()
 {
     return(ThemeSettings.Aggregate(Source, (current, color) => current.Replace("{" + color.ID + "}", color.Value)));
 }
Esempio n. 27
0
        public CommonController(
            ICommonServices services,
            ITopicService topicService,
            Lazy <ILanguageService> languageService,
            Lazy <ICurrencyService> currencyService,
            IThemeContext themeContext,
            Lazy <IThemeRegistry> themeRegistry,
            Lazy <IForumService> forumService,
            Lazy <IGenericAttributeService> genericAttributeService,
            Lazy <IMobileDeviceHelper> mobileDeviceHelper,
            Lazy <ICompareProductsService> compareProductsService,
            Lazy <IUrlRecordService> urlRecordService,
            StoreInformationSettings storeInfoSettings,
            CustomerSettings customerSettings,
            PrivacySettings privacySettings,
            TaxSettings taxSettings,
            CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            EmailAccountSettings emailAccountSettings,
            CommonSettings commonSettings,
            NewsSettings newsSettings,
            BlogSettings blogSettings,
            ForumSettings forumSettings,
            LocalizationSettings localizationSettings,
            Lazy <SecuritySettings> securitySettings,
            Lazy <SocialSettings> socialSettings,
            Lazy <MediaSettings> mediaSettings,
            IOrderTotalCalculationService orderTotalCalculationService,
            IPriceFormatter priceFormatter,
            ThemeSettings themeSettings,
            IPageAssetsBuilder pageAssetsBuilder,
            Lazy <IPictureService> pictureService,
            Lazy <IManufacturerService> manufacturerService,
            Lazy <IProductService> productService,
            Lazy <IShoppingCartService> shoppingCartService,
            IBreadcrumb breadcrumb)
        {
            _services                = services;
            _topicService            = topicService;
            _languageService         = languageService;
            _currencyService         = currencyService;
            _themeContext            = themeContext;
            _themeRegistry           = themeRegistry;
            _forumservice            = forumService;
            _genericAttributeService = genericAttributeService;
            _compareProductsService  = compareProductsService;
            _urlRecordService        = urlRecordService;

            _storeInfoSettings    = storeInfoSettings;
            _customerSettings     = customerSettings;
            _privacySettings      = privacySettings;
            _taxSettings          = taxSettings;
            _catalogSettings      = catalogSettings;
            _shoppingCartSettings = shoppingCartSettings;
            _commonSettings       = commonSettings;
            _newsSettings         = newsSettings;
            _blogSettings         = blogSettings;
            _forumSettings        = forumSettings;
            _localizationSettings = localizationSettings;
            _securitySettings     = securitySettings;
            _socialSettings       = socialSettings;
            _mediaSettings        = mediaSettings;

            _orderTotalCalculationService = orderTotalCalculationService;
            _priceFormatter = priceFormatter;

            _themeSettings       = themeSettings;
            _pageAssetsBuilder   = pageAssetsBuilder;
            _pictureService      = pictureService;
            _manufacturerService = manufacturerService;
            _productService      = productService;
            _shoppingCartService = shoppingCartService;

            _breadcrumb = breadcrumb;
        }
Esempio n. 28
0
 private void mnuThemeSettings_Click(object sender, EventArgs e)
 {
     new FormThemeSettings(ThemeSettings.LoadDefaultTheme()).ShowDialog();
 }
Esempio n. 29
0
 public void SaveTheme(ThemeSettings settings)
 {
     Session["ThemeSettings"] = settings;
 }
Esempio n. 30
0
        public static void ApplyTheme(Control.ControlCollection cntrls, ThemeSettings theme)
        {
            //ThemeSettings theme = new ThemeSettings(Properties.Settings.Default.Theme);

            foreach (object obj in cntrls)
            {
                if (obj is Button)
                {
                    Button btn = (Button)obj;
                    btn.BackColor = theme.btnColor;
                    btn.ForeColor = theme.btnFont;
                }
                else if (obj is Panel)
                {
                    ApplyTheme(((Panel)obj).Controls, theme);
                    Panel pan = (Panel)obj;
                    if (pan.Name.StartsWith("main"))
                    {
                        pan.BackColor = theme.PanColor;
                        pan.ForeColor = theme.MainFormColor;
                    }
                    else if (pan.Name.StartsWith("sub"))
                    {
                        pan.BackColor = theme.SubPanColor;
                        pan.ForeColor = theme.MainFormColor;
                    }
                }
                else if (obj is Label)
                {
                    Label lbl = (Label)obj;
                    if (lbl.Name.StartsWith("main"))
                    {
                        lbl.BackColor = theme.PanColor;
                        lbl.ForeColor = theme.PanFontColor;
                    }
                    if (lbl.Name.StartsWith("sub"))
                    {
                        lbl.ForeColor = theme.SubPanFontColor;
                    }
                    if (lbl.Name.StartsWith("lbl") || lbl.Name.StartsWith("label"))
                    {
                        lbl.ForeColor = theme.MainFontColor;
                    }
                    if (lbl.Name.StartsWith("txt"))
                    {
                        lbl.BackColor = theme.TextBackColor;
                        lbl.ForeColor = theme.TextFontColor;
                    }
                }
                else if (obj is CheckBox)
                {
                    CheckBox lbl = (CheckBox)obj;
                    lbl.ForeColor = theme.MainFontColor;
                }
                else if (obj is TextBox)
                {
                    TextBox txt = (TextBox)obj;
                    txt.BackColor = theme.TextBackColor;
                    txt.ForeColor = theme.TextFontColor;
                }
                else if (obj is ListBox)
                {
                    ListBox txt = (ListBox)obj;
                    txt.BackColor = theme.TextBackColor;
                    txt.ForeColor = theme.TextFontColor;
                }
            }
        }
Esempio n. 31
0
        protected virtual ThemeManifestModel PrepareThemeManifestModel(ThemeManifest manifest, ThemeSettings themeSettings)
        {
            var model = new ThemeManifestModel
            {
                Name            = manifest.ThemeName,
                BaseTheme       = manifest.BaseThemeName,
                Title           = manifest.ThemeTitle,
                Description     = manifest.PreviewText,
                Author          = manifest.Author,
                Url             = manifest.Url,
                Version         = manifest.Version,
                PreviewImageUrl = manifest.PreviewImageUrl.HasValue() ? manifest.PreviewImageUrl : "{0}{1}/preview.png".FormatInvariant(manifest.Location.EnsureEndsWith("/"), manifest.ThemeName),
                IsActive        = themeSettings.DefaultTheme == manifest.ThemeName,
                State           = manifest.State,
            };

            model.IsConfigurable = HostingEnvironment.VirtualPathProvider.FileExists("{0}{1}/Views/Shared/ConfigureTheme.cshtml".FormatInvariant(manifest.Location.EnsureEndsWith("/"), manifest.ThemeName));

            return(model);
        }