Exemplo n.º 1
0
        /// <summary>
        /// Returns the bundle stream for given themes.
        /// </summary>
        /// <param name="themes">Themes.</param>
        /// <returns>Bundle stream.</returns>
        public Stream GetBundleStream(UserThemeResult themes = null)
        {
            int userId = GetUserId();

            return(userId > 0 ? ThemeSource.GetBundleStream <UserTheme, UserThemeResult>(
                       string.Format("~/App_Data/Themes/{0}", userId), GetImportedThemes()) : null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the bundle stream for given themes.
        /// </summary>
        /// <param name="themes">Themes.</param>
        /// <returns>Bundle stream.</returns>
        public Stream GetBundleStream(GitHubThemeResult themes = null)
        {
            Stream ret = null;
            GitHubInMemoryTheme inMemoryTheme = null;

            if (themes == null)
            {
                inMemoryTheme = GetUrlSpecifiedTheme();

                if (inMemoryTheme != null)
                {
                    ret = new MemoryStream(inMemoryTheme.Content);
                }
            }

            if (ret == null)
            {
                if (themes == null)
                {
                    themes = ImportThemes();
                }

                ret = ThemeSource.GetBundleStream <GitHubTheme, GitHubThemeResult>("~/Assets/css/Themes/", themes);
            }

            return(ret);
        }