private static string ProcessStyleSheet(string styleSheetContent, DetailMenuTheme theme) { if (theme == DetailMenuTheme.Modern) { return(ProcessStyleSheet(styleSheetContent, new string[] { "Arrow.png", "CheckBox.png", "CheckBoxChecked.png" }, ResourceProvider.GetDetailMenuThemeResource(theme, "{0}"))); } return(styleSheetContent); }
internal static bool IsDetailMenuThemeStyleSheet(string resourceName, out DetailMenuTheme detailMenuTheme) { detailMenuTheme = DetailMenuTheme.Standard; foreach (DetailMenuTheme theme in Enum.GetValues(typeof(DetailMenuTheme))) { if (resourceName.EndsWith(GetDetailMenuThemeStyleSheet(theme), StringComparison.OrdinalIgnoreCase)) { detailMenuTheme = theme; return(true); } } return(false); }
internal static string GetDetailMenuThemeResource(DetailMenuTheme theme, string resourceName) { return(string.Format(CultureInfo.InvariantCulture, "Images.DetailMenuThemes.{0}.{1}", theme, resourceName)); }
internal static string GetDetailMenuThemeStyleSheet(DetailMenuTheme theme) { return(string.Format(CultureInfo.InvariantCulture, "Styles.DetailMenuThemes.{0}.css", theme)); }
private static void GetEmbeddedResource(string resourceName, ref byte[] content, ref string contentType, ref string name, ref bool cacheable) { if (string.IsNullOrEmpty(resourceName)) { return; } string[] parts = resourceName.Split('?'); resourceName = parts[0]; name = GetResourceFileName(resourceName); contentType = MimeType.GetMimeType(Support.GetLastPartOfString(resourceName, ".", true), MimeType.Text); resourceName = ManifestResourceNamePrefix + "." + resourceName; MasterPageTheme masterPageTheme = MasterPageTheme.Standard; MasterPageThemeColor masterPageThemeColor = MasterPageThemeColor.Red; DetailMenuTheme detailMenuTheme = DetailMenuTheme.Standard; if (resourceName.EndsWith(CustomStyleSheet, StringComparison.OrdinalIgnoreCase)) { cacheable = false; string styleSheet = null; if (parts.Length > 0) { object obj = Support.ConvertStringToType(parts[1], typeof(Guid)); if (obj != null) { styleSheet = SettingProvider.GetCustomStyleSheet((Guid)obj); } } if (!Support.StringIsNullOrEmpty(styleSheet)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessStyleSheet(styleSheet, FrameworkConfiguration.Current.WebApplication.MasterPage.Theme, FrameworkConfiguration.Current.WebApplication.MasterPage.ThemeColor)); } else { content = new byte[] { } }; } else if (resourceName.EndsWith(ComboBoxModernStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessComboBoxModernStyleSheet(GetManifestResourceString(resourceName))); } else if (IsMasterPageThemeColorStyleSheet(resourceName, out masterPageTheme, out masterPageThemeColor)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessStyleSheet(GetManifestResourceString(resourceName), masterPageTheme, masterPageThemeColor)); } else if (IsDetailMenuThemeStyleSheet(resourceName, out detailMenuTheme)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessStyleSheet(GetManifestResourceString(resourceName), detailMenuTheme)); } else if (resourceName.EndsWith(BootstrapStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessBootstrapStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(FancyBoxStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessFancyBoxStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(GlobalModernStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessStyleSheet(GetManifestResourceString(resourceName), MasterPageTheme.Modern, MasterPageThemeColor.NotSet)); } else if (resourceName.EndsWith(CommonGridViewModernStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessCommonGridViewModernStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(AccountSettingsStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessAccountSettingsStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(CreditCardRegistrationStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessCreditCardRegistrationStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(OnOffSwitchStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessOnOffSwitchStyleSheet(GetManifestResourceString(resourceName))); } else if (resourceName.EndsWith(NoticeMessageBoxStyleSheet, StringComparison.OrdinalIgnoreCase)) { content = UnicodeEncoding.UTF8.GetBytes(ProcessNoticeMessageBoxStyleSheet(GetManifestResourceString(resourceName))); } else { content = GetManifestResourceBytes(resourceName); } }