Ejemplo n.º 1
0
        static public async Task <CommunityNewsViewModel> Create(
            string communityId,
            string title,
            string authorName,
            DateTime postAt,
            string contentHtml,
            PageManager pageManager,
            AppearanceSettings appearanceSettings
            )
        {
            ApplicationTheme appTheme;

            if (appearanceSettings.ApplicationTheme == ElementTheme.Dark)
            {
                appTheme = ApplicationTheme.Dark;
            }
            else if (appearanceSettings.ApplicationTheme == ElementTheme.Light)
            {
                appTheme = ApplicationTheme.Light;
            }
            else
            {
                appTheme = Views.Helpers.SystemThemeHelper.GetSystemTheme();
            }

            var id  = $"{communityId}_{postAt.ToString("yy-MM-dd-H-mm")}";
            var uri = await HtmlFileHelper.PartHtmlOutputToCompletlyHtml(id, contentHtml, appTheme);

            return(new CommunityNewsViewModel(communityId, title, authorName, postAt, uri, pageManager));
        }
Ejemplo n.º 2
0
        //
        public async Task <Uri> MakeLiveSummaryHtmlUri()
        {
            if (PlayerStatusResponse == null)
            {
                return(null);
            }

            var desc = PlayerStatusResponse.Program.Description;

            return(await HtmlFileHelper.PartHtmlOutputToCompletlyHtml(LiveId, desc));
        }