using TheArtOfDev.HtmlRenderer.WinForms;
///
///
///
namespace com.insanitydesign.MarkdownViewerPlusPlus.Forms
{
///
///
///
public class MarkdownViewerHtmlPanel : HtmlPanel
{
///
///
///
public MarkdownViewerHtmlPanel()
{
this.AllowDrop = false;
this.Dock = System.Windows.Forms.DockStyle.Fill;
this.IsContextMenuEnabled = false;
this.Location = new System.Drawing.Point(0, 24);
this.MinimumSize = new System.Drawing.Size(20, 20);
this.Name = "markdownViewerHtmlPanel";
this.Size = new System.Drawing.Size(284, 237);
this.TabIndex = 0;
this.AvoidImagesLateLoading = false;
}
///
///
///
public override string Text {
get { return _text; }
set {
_text = value;
if (!IsDisposed)
{
_htmlContainer.SetHtml(_text, _baseCssData);
Redraw();
}
}
}
///
/// Scroll by the given ratio, calculated with max and page
///
///
public void ScrollByRatioVertically(double scrollRatio)
{
if (!IsDisposed)
{
VerticalScroll.Value = (int)((VerticalScroll.Maximum - VerticalScroll.LargeChange) * scrollRatio);
Redraw();
}
}
///
///
///
protected void Redraw()
{
PerformLayout();
Invalidate();
InvokeMouseMove();
}
}
}