本文整理汇总了C#中Browser.NavigateRawHtml方法的典型用法代码示例。如果您正苦于以下问题:C# Browser.NavigateRawHtml方法的具体用法?C# Browser.NavigateRawHtml怎么用?C# Browser.NavigateRawHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser.NavigateRawHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LicenseDialog
public LicenseDialog()
{
InitializeComponent();
Text = string.Format(Text, Assembly.GetExecutingAssembly().GetName().Version);
_licenseBrowser = new Browser();
_licenseBrowser.Isolator = new NavigationIsolator(); // never used while other browsers are around
_licenseBrowser.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
_licenseBrowser.Location = new Point(12, 12);
_licenseBrowser.Name = "licenseBrowser";
_licenseBrowser.Size = new Size(_acceptButton.Right - 12, _acceptButton.Top - 24);
Controls.Add(_licenseBrowser);
var options = new MarkdownOptions() { LinkEmails = true, AutoHyperlink = true };
var m = new Markdown(options);
var locale = CultureInfo.CurrentUICulture.Name;
string licenseFilePath = BloomFileLocator.GetFileDistributedWithApplication("license.md");
var localizedLicenseFilePath = licenseFilePath.Substring(0, licenseFilePath.Length - 3) + "-" + locale + ".md";
if (RobustFile.Exists(localizedLicenseFilePath))
licenseFilePath = localizedLicenseFilePath;
else
{
var index = locale.IndexOf('-');
if (index > 0)
{
locale = locale.Substring(0, index);
localizedLicenseFilePath = licenseFilePath.Substring(0, licenseFilePath.Length - 3) + "-" + locale + ".md";
if (RobustFile.Exists(localizedLicenseFilePath))
licenseFilePath = localizedLicenseFilePath;
}
}
var contents = m.Transform(RobustFile.ReadAllText(licenseFilePath, Encoding.UTF8));
var html = string.Format("<html><head><head/><body>{0}</body></html>", contents);
_licenseBrowser.NavigateRawHtml(html);
_licenseBrowser.Visible = true;
}