private HtmlView PostItemTextBlock(string text) { HtmlView textBlock = new HtmlView(); textBlock.Html = text; textBlock.Margin = new Thickness(10); return(textBlock); }
public IViewContent CreateContentForFile(string fileName) { HtmlView htmlView = new HtmlView(); htmlView.LoadFile(fileName); return(htmlView); }
public HtmlViewModel ToModel(HtmlView htmlView) { HtmlViewModel model = new HtmlViewModel(); model.Html = htmlView.GetValueOrDefault("html").ToStringOrDefault(); model.Title = htmlView.GetValueOrDefault("title").ToStringOrDefault(); return(model); }
private HtmlView GetHtmlControl(string content) { HtmlView htmlview = new HtmlView(); htmlview.Html = content.Replace("cite", "b").Replace("</b>", "</b><br>"); htmlview.FontSize = 14; htmlview.Foreground = grayColor; return(htmlview); }
public static string CreatorActionLink(HtmlView view, ViewContext context, Match linkMatch) { var linkAttributes = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); MatchCollection linkAttributeMatches = RegularExpressions.AttributeNameValue.Matches(linkMatch.Value); foreach (Match linkAttributeMatch in linkAttributeMatches) { string attributeName = linkAttributeMatch.Groups[1].Value.Trim(); if (String.Equals("routeValues", attributeName, StringComparison.OrdinalIgnoreCase) || String.Equals("htmlAttributes", attributeName, StringComparison.OrdinalIgnoreCase)) { linkAttributes[attributeName] = DeserializeObjectAsDictionary(linkAttributeMatch.Groups[2].Value); } else { linkAttributes[attributeName] = linkAttributeMatch.Groups[2].Value.Trim(); } } object action, controller, routeValues, htmlAttributes; linkAttributes.TryGetValue("action", out action); linkAttributes.TryGetValue("controller", out controller); if (linkAttributes.TryGetValue("routeValues", out routeValues) && routeValues is IDictionary<string, object>) { routeValues = new RouteValueDictionary((IDictionary<string, object>) routeValues); } else { routeValues = null; } if (!linkAttributes.TryGetValue("htmlAttributes", out htmlAttributes) || !(htmlAttributes is IDictionary<string, object>)) { htmlAttributes = null; } string value = linkMatch.Groups[2].Value; if (IsNullOrEmpty(value)) { value = "action link"; } var helper = new HtmlHelper(context, view); string link = helper.ActionLink(ValueToken, action as string, controller as string, (RouteValueDictionary) routeValues, (IDictionary<string, object>) htmlAttributes).ToHtmlString(); return link.Replace(ValueToken, value); }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); // Load base html string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; var isRtl = Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft; HtmlView.Navigate(new Uri(Path.Combine(path, isRtl ? "editor_rtl.html" : "editor.html"))); }
/// <summary> /// 刷新页面 /// </summary> public void Navigate() { if (ReportViewType == ReportViewType.Export) { HtmlView.Navigate(reportExportContent, ReportAbsoluteUrl); } else { HtmlView.Navigate(reportContent, ReportAbsoluteUrl); } }
/// <summary> /// 刷新Congos页面 /// </summary> public void Navigate() { if (CognosViewType == ReportViewType.Export) { HtmlView.Navigate(congosExportContent, CognosAbsoluteUrl); } else { HtmlView.Navigate(congosContent, CognosAbsoluteUrl); } }
void IViewController.Show(IFormClosedListener listener) { totalFireBansView = new HtmlView(); totalFireBansView.Text = "Total Fire Bans"; totalFireBansView.TabText = "Total Fire Bans"; TotalFireBanViewController totalFireBanViewController = new TotalFireBanViewController(rssReaderFactory, totalFireBansView); hostServices.Show(totalFireBansView, DockState.DockLeft); totalFireBanViewController.Start(options); }
private void cPFToolStripMenuItem_Click(object sender, EventArgs e) { PesquisaClienteCpf pesquisaClienteCpf = new PesquisaClienteCpf(); if (pesquisaClienteCpf.ShowDialog() == DialogResult.OK) { HtmlView htmlView = new HtmlView(pesquisaClienteCpf.result); htmlView.Dock = DockStyle.Fill; painel_central.Controls.Clear(); painel_central.Controls.Add(htmlView); } }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; HtmlView.Navigate(new Uri(Path.Combine(path, "ThreadView.html"))); ICustomDoc doc = (ICustomDoc)HtmlView.Document; doc.SetUIHandler(new DocHostUIHandler()); }
static void Main(string[] args) { Dictionary <object, TimeTracker> trackers = new Dictionary <object, TimeTracker>() { { "Inbound", new TimeTracker(name: "Inbound", trackingCondition: (x) => x.Direction == CommDirection.Inbound && x.WasReceived == true) }, { "Outbound", new TimeTracker(name: "Outbound", trackingCondition: (x) => x.Direction == CommDirection.Outbound) }, { "Abandoned", new TimeTracker(name: "Abandoned", trackingCondition: (x) => x.WasReceived == false) } }; Accounts accounts = new Accounts(sentinel, trackers); CommunicationProcessor processor = new CommunicationProcessor(); processor.RegisterCallback(accounts.AddCommunication); var cfg = ConfigurationManager.GetSection("resources") as ResourcesConfiguration; foreach (ResourceElement resource in cfg.Resources) { processor.ProcessResource(resource); } string outputPath = ConfigurationManager.AppSettings["OutputPath"]; string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); if (outputPath != "Desktop") { path = outputPath; } BarChartView barChart = new BarChartView(new AccountsBarChartAdapter(accounts, AccountsBarChartAdapter.SeriesCtor)); var barChartPath = Path.Combine(path, @"barChart.png"); barChart.SaveToFile(barChartPath); LineChartView lineChart = new LineChartView(new TimeTrackersLineChartAdapter(trackers.Values, TimeTrackersLineChartAdapter.SeriesCtor)); var lineChartPath = Path.Combine(path, @"lineChart.png"); lineChart.SaveToFile(lineChartPath); HtmlView htmlView = new HtmlView(new AccountsHtmlAdapter(accounts, AccountsHtmlAdapter.SeriesCtor)); htmlView.SaveToFile(Path.Combine(path, @"view.html")); ViewMailer mailer = new ViewMailer(htmlView.AsCode); mailer.ImbedImageAtId("barChart", barChartPath); mailer.ImbedImageAtId("lineChart", lineChartPath); //mailer.SendMail(new MailClient().Client); }
private void _laodHtml() { _timer = Task.Factory.StartNew(() => { while (true) { Thread.Sleep(200); if (!string.IsNullOrEmpty(HtmlEditor.Text)) { this.Dispatcher.Invoke(() => { HtmlView.NavigateToString(HtmlEditor.Text); }); } } }); }
void DoubleClick(object sender, EventArgs e) { TreeNode node = treeView.SelectedNode; if (node.Tag != null) { string navigationName = "mk:@MSITStore:" + helpPath + node.Tag.ToString(); if (htmlView == null) { htmlView = new HtmlView(); WorkbenchSingleton.Workbench.ShowView(htmlView); htmlView.CloseEvent += new EventHandler(HelpBrowserWindowClose); } htmlView.LoadFile(navigationName); } }
public TextPage(BeyondRootModel Page) { NavigationPage.SetBackButtonTitle (this, ""); this.Title = Page.pageName; RelativeLayout pageLayout = new RelativeLayout (); StackLayout pageView = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand }; ScrollView scrollContent = new ScrollView { Content = pageView, VerticalOptions = LayoutOptions.FillAndExpand }; HtmlView test = new HtmlView (); ContentView slideContentHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(10,10,10,0) }; Image backgroundImage = new Image () { Source = "bg4.jpg", Aspect = Aspect.AspectFill }; slideContentHolder.Content = test; test.Text = Page.slideContent; pageLayout.Children.Add (backgroundImage, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageLayout.Children.Add (scrollContent, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageView.Children.Add (slideContentHolder); this.Content = pageLayout; }
public ReportView() { InitializeComponent(); congosContent = HtmlView.CreateHtmlView() as FrameworkElement; congosExportContent = HtmlView.CreateHtmlView() as FrameworkElement; congosExportContent.Height = 0; congosExportContent.Width = 0; Grid.SetRow(congosExportContent, 1); root.Children.Add(congosExportContent); Grid.SetRow(congosContent, 0); root.Children.Add(congosContent); }
private void SetGridContent(string html) { if (string.IsNullOrEmpty(html)) return; htmlDoc.LoadHtml(html); ST.Children.Clear(); StackPanel gridC = new StackPanel(); List<HtmlNodeCollection> userList = htmlDoc.DocumentNode.Descendants().Where (x => (x.Name == "div" && x.Attributes["class"] != null && x.Attributes["class"].Value.Contains("comment-content"))). Select(x => x.ChildNodes).ToList(); if (userList.Count == 0) { HtmlView htmlViewr = new HtmlView(); htmlViewr.Html = html; htmlViewr.FontSize = 14; htmlViewr.Foreground = (Brush)(Application.Current.Resources["ForegroundCustomOtherBlackBrush"]); gridC.Children.Add(htmlViewr); } else { foreach (var item in userList[0]) { if (item.Name.Equals("blockquote")) { liststring.Add(new CommentsContent("blockquote", item.InnerHtml)); } else if (item.Name.Equals("p")) { liststring.Add(new CommentsContent("p", item.InnerHtml)); } } foreach (var item in liststring) { if (item.Tag.Equals("p")) { HtmlView htmlViewr = new HtmlView(); htmlViewr.Html = item.Content; htmlViewr.FontSize = 14; htmlViewr.Foreground = (Brush)(Application.Current.Resources["ForegroundCustomOtherBlackBrush"]); gridC.Children.Add(htmlViewr); } else if (item.Tag.Equals("blockquote")) { htmlDoc.LoadHtml(item.Content); List<HtmlNode> countBlo = htmlDoc.DocumentNode.Descendants("blockquote").ToList(); countBlock = countBlo.Count + 1; var bordres = ReturnBorderComplete(item.Content); gridC.Children.Add(bordres); countStep = 0; } } } liststring.Clear(); ST.Children.Add(gridC); }
private HtmlView GetHtmlControl(string content) { HtmlView htmlview = new HtmlView(); htmlview.Html = content.Replace("cite", "b").Replace("</b>", "</b><br>"); htmlview.FontSize = 14; htmlview.Foreground = grayColor; return htmlview; }
private void Button_Click(object sender, RoutedEventArgs e) { HtmlView.NavigateToString(HtmlEditor.Text); }
public void Hide() { HtmlView.Dispose(); }
private void SetGridContent(string html) { if (string.IsNullOrEmpty(html)) { return; } htmlDoc.LoadHtml(html); ST.Children.Clear(); StackPanel gridC = new StackPanel(); List <HtmlNodeCollection> userList = htmlDoc.DocumentNode.Descendants().Where (x => (x.Name == "div" && x.Attributes["class"] != null && x.Attributes["class"].Value.Contains("comment-content"))). Select(x => x.ChildNodes).ToList(); if (userList.Count == 0) { HtmlView htmlViewr = new HtmlView(); htmlViewr.Html = html; htmlViewr.FontSize = 14; htmlViewr.Foreground = (Brush)(Application.Current.Resources["ForegroundCustomOtherBlackBrush"]); gridC.Children.Add(htmlViewr); } else { foreach (var item in userList[0]) { if (item.Name.Equals("blockquote")) { liststring.Add(new CommentsContent("blockquote", item.InnerHtml)); } else if (item.Name.Equals("p")) { liststring.Add(new CommentsContent("p", item.InnerHtml)); } } foreach (var item in liststring) { if (item.Tag.Equals("p")) { HtmlView htmlViewr = new HtmlView(); htmlViewr.Html = item.Content; htmlViewr.FontSize = 14; htmlViewr.Foreground = (Brush)(Application.Current.Resources["ForegroundCustomOtherBlackBrush"]); gridC.Children.Add(htmlViewr); } else if (item.Tag.Equals("blockquote")) { htmlDoc.LoadHtml(item.Content); List <HtmlNode> countBlo = htmlDoc.DocumentNode.Descendants("blockquote").ToList(); countBlock = countBlo.Count + 1; var bordres = ReturnBorderComplete(item.Content); gridC.Children.Add(bordres); countStep = 0; } } } liststring.Clear(); ST.Children.Add(gridC); }
public ContactPage(BeyondRootModel Page) { NavigationPage.SetBackButtonTitle (this, ""); this.Title = Page.pageName; RelativeLayout pageLayout = new RelativeLayout (); StackLayout pageView = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand }; StackLayout ButtonSection = new StackLayout { Spacing = 15, Padding = new Thickness(15,15,15,0), VerticalOptions = LayoutOptions.FillAndExpand }; ScrollView scrollContent = new ScrollView { Content = pageView, VerticalOptions = LayoutOptions.FillAndExpand }; HtmlView test = new HtmlView (); Label ContactInfo = new Label () { FontFamily = Device.OnPlatform("Orbitron", null, null), TextColor = Color.White, XAlign = TextAlignment.Center }; ContentView slideContentHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(10,10,10,0) }; ContentView slideContentHolder2 = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(10,10,10,0) }; Image backgroundImage = new Image () { Source = "bg4.jpg", Aspect = Aspect.AspectFill }; test.Text = Page.copyrightInformation; ContactInfo.Text = "Version 1.0 \n\n Contact [email protected] for any queries or information about this application \n\n Thankyou for downloading our App! \n"; slideContentHolder2.Content = test; slideContentHolder.Content = ContactInfo; pageLayout.Children.Add (backgroundImage, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageLayout.Children.Add (scrollContent, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageView.Children.Add (slideContentHolder); pageView.Children.Add (slideContentHolder2); pageView.Children.Add (ButtonSection); ButtonSection.Children.Add (new BeyondButton { Text = "Wiki", Command = new Command (async c => { Device.OpenUri(new Uri("http://www.indiedb.com/games/beyond-flesh-and-blood")); }) }); ButtonSection.Children.Add (new BeyondButton { Text = "Forum", Command = new Command (async c => { Device.OpenUri(new Uri("http://beyondfleshandbloodgame.com/forum")); }) }); ButtonSection.Children.Add (new BeyondButton { Text = "Blog", Command = new Command (async c => { Device.OpenUri(new Uri("http://beyondfleshandbloodgame.com/d/blog/")); }) }); this.Content = pageLayout; }
public CharacterViewPage(BeyondCharacterModel Page) { NavigationPage.SetBackButtonTitle (this, " "); this.Title = Page.pageName; RelativeLayout pageLayout = new RelativeLayout (); StackLayout pageView = new StackLayout () { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; ScrollView scrollContent = new ScrollView { Content = pageView, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; HtmlView test = new HtmlView (); ContentView slideContentHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(10,10,10,0) }; ContentView imageHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(0,15,0,15) }; Image storyImage = new Image () { HeightRequest = 450, Aspect = Aspect.AspectFit }; Image backgroundImage = new Image () { Source = "bg2.jpg", Aspect = Aspect.AspectFill }; Byte[] ImageBase64 = System.Convert.FromBase64String(Page.characterRightHandSideImage); storyImage.Source = ImageSource.FromStream (() => new System.IO.MemoryStream (ImageBase64)); slideContentHolder.Content = test; imageHolder.Content = storyImage; test.Text = Page.characterDescription; pageLayout.Children.Add (backgroundImage, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageLayout.Children.Add (scrollContent, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); pageView.Children.Add (imageHolder); pageView.Children.Add (slideContentHolder); ContentView statsHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(5,5,5,5)}; HtmlView stats = new HtmlView () { Text = BeyondUtility.stripUnRequiredTags(Page.characterStats), XAlign = TextAlignment.Center, YAlign = TextAlignment.Center }; statsHolder.Content = stats; pageView.Children.Add (statsHolder); if (Page.characterScreenshotsConceptArt != null) { ContentView labelView = new ContentView { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = 10 }; Label text = new Label () { FontFamily = Device.OnPlatform("Orbitron",null,null), TextColor = Color.White, Text = "Tap an image to view a larger version", XAlign = TextAlignment.Center }; labelView.Content = text; ContentView imagesHolder = new ContentView () { BackgroundColor = new Color (0, 0, 0, 0.5), Padding = new Thickness(0,0,0,0) }; WrapLayout layout = new WrapLayout () { Spacing = 0, Orientation = StackOrientation.Horizontal }; List<Frame> imageList = new List<Frame> (); int i = 0; int imgwidth = 0; if ((DeviceInfo.Instance.ScreenWidth % 3) == 0) { imgwidth = (DeviceInfo.Instance.ScreenWidth / 3); } if ((DeviceInfo.Instance.ScreenWidth % 4) == 0) { imgwidth = (DeviceInfo.Instance.ScreenWidth / 3); } if ((DeviceInfo.Instance.ScreenWidth % 6) == 0) { imgwidth = (DeviceInfo.Instance.ScreenWidth / 3); } if ((DeviceInfo.Instance.ScreenWidth % 8) == 0) { imgwidth = (DeviceInfo.Instance.ScreenWidth / 3); } if ((DeviceInfo.Instance.ScreenWidth % 10) == 0) { imgwidth = (DeviceInfo.Instance.ScreenWidth / 3); } foreach (BeyondImage image in Page.characterScreenshotsConceptArt) { imageList.Add(new Frame () { HeightRequest = imgwidth, WidthRequest = imgwidth, HasShadow = false, Padding = 0, OutlineColor = Color.FromHex("007DA1"), Content = new Image () { Source = ImageSource.FromStream (() => new System.IO.MemoryStream (image.image)), Aspect = Aspect.AspectFill } }); imageList [i].GestureRecognizers.Add (new TapGestureRecognizer { Command = new Command (() => { Navigation.PushAsync(new ContentPage () { Title = "View Image", BackgroundColor = Color.White, ToolbarItems = { new ToolbarItem ("Download", null, async () => { Device.OpenUri (new Uri(image.url)); }) }, Content = new Image () { HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill, Source = ImageSource.FromStream (() => new System.IO.MemoryStream (image.image)), Aspect = Aspect.AspectFit } }); }), NumberOfTapsRequired = 1 }); layout.Children.Add(imageList[i]); i++; } imagesHolder.Content = layout; pageView.Children.Add (labelView); pageView.Children.Add (imagesHolder); } this.Content = pageLayout; }
private HtmlView PostItemTextBlock(string text) { HtmlView textBlock = new HtmlView(); textBlock.Html = text; textBlock.Margin = new Thickness(10); return textBlock; }
void HelpBrowserWindowClose(object sender, EventArgs e) { htmlView = null; }
protected override void OnClosed(EventArgs e) { base.OnClosed(e); HtmlView.Dispose(); }
/// <summary> /// 导航绝对页面 /// </summary> /// <param name="url"></param> public void Navigate(string url) { HtmlView.Navigate(reportContent, url); }
void TimerTick(object sender, EventArgs e) { HtmlView.LoadHtml(GetMessageHtmlView(message)); timer.IsEnabled = false; }