Example #1
0
 /// <summary>
 /// 执行添加下划线命令
 /// </summary>
 public static void Underline(this HtmlDocument document)
 {
     document.ExecuteCommand("Underline", false, null);
 }
Example #2
0
 /// <summary>
 /// 执行清除样式命令
 /// </summary>
 public static void ClearStyle(this HtmlDocument document)
 {
     document.ExecuteCommand("RemoveFormat", false, null);
 }
Example #3
0
 /// <summary>
 /// 设置上标命令是否可执行
 /// </summary>
 public static bool CanSuperscript(this HtmlDocument document)
 {
     return(document.QueryCommandSupported("Superscript") && document.QueryCommandEnabled("Superscript"));
 }
Example #4
0
 /// <summary>
 /// 是否是斜体
 /// </summary>
 public static bool IsItalic(this HtmlDocument document)
 {
     return(document.QueryCommandState("Italic"));
 }
Example #5
0
 /// <summary>
 /// 复制命令是否可执行
 /// </summary>
 public static bool CanCopy(this HtmlDocument document)
 {
     return(document.QueryCommandEnabled("Copy"));
 }
Example #6
0
 /// <summary>
 /// 删除命令是否可执行
 /// </summary>
 public static bool CanDelete(this HtmlDocument document)
 {
     return(document.QueryCommandEnabled("Delete"));
 }
Example #7
0
 /// <summary>
 /// 执行复制命令
 /// </summary>
 public static void Copy(this HtmlDocument document)
 {
     document.ExecuteCommand("Copy", false, null);
 }
Example #8
0
 /// <summary>
 /// 执行设为有序列表命令
 /// </summary>
 public static void NumberedList(this HtmlDocument document)
 {
     document.ExecuteCommand("InsertOrderedList", false, null);
 }
Example #9
0
 /// <summary>
 /// 是否是有序列表
 /// </summary>
 public static bool IsNumberedList(this HtmlDocument document)
 {
     return(document.QueryCommandState("InsertOrderedList"));
 }
Example #10
0
 /// <summary>
 /// 执行重做命令
 /// </summary>
 public static void Redo(this HtmlDocument document)
 {
     document.ExecuteCommand("Redo", false, null);
 }
Example #11
0
 /// <summary>
 /// 是否是无序列表
 /// </summary>
 public static bool IsBulletsList(this HtmlDocument document)
 {
     return(document.QueryCommandState("InsertUnorderedList"));
 }
Example #12
0
 /// <summary>
 /// 是否是下标
 /// </summary>
 public static bool IsSubscript(this HtmlDocument document)
 {
     return(document.QueryCommandSupported("Subscript") &&
            document.QueryCommandState("Subscript"));
 }
Example #13
0
 /// <summary>
 /// 是否有下划线
 /// </summary>
 public static bool IsUnderline(this HtmlDocument document)
 {
     return(document.QueryCommandState("Underline"));
 }
Example #14
0
 /// <summary>
 /// 执行减少缩进命令
 /// </summary>
 /// <param name="document"></param>
 public static void Outdent(this HtmlDocument document)
 {
     document.ExecuteCommand("Outdent", false, null);
 }
Example #15
0
 /// <summary>
 /// 重做命令是否可执行
 /// </summary>
 public static bool CanRedo(this HtmlDocument document)
 {
     return(document.QueryCommandEnabled("Redo"));
 }
Example #16
0
 /// <summary>
 /// 执行设为无序列表命令
 /// </summary>
 public static void BulletsList(this HtmlDocument document)
 {
     document.ExecuteCommand("InsertUnorderedList", false, null);
 }
Example #17
0
 /// <summary>
 /// 执行删除命令
 /// </summary>
 public static void Delete(this HtmlDocument document)
 {
     document.ExecuteCommand("Delete", false, null);
 }
Example #18
0
 /// <summary>
 /// 执行设为两端对齐命令
 /// </summary>
 public static void JustifyFull(this HtmlDocument document)
 {
     document.ExecuteCommand("JustifyFull", false, null);
 }
Example #19
0
 /// <summary>
 /// 执行全选命令
 /// </summary>
 public static void SelectAll(this HtmlDocument document)
 {
     document.ExecuteCommand("SelectAll", false, null);
 }
Example #20
0
 /// <summary>
 /// 设置文档选区的字体
 /// </summary>
 public static void SetFontFamily(this HtmlDocument document, FontFamily value)
 {
     document.ExecuteCommand("FontName", false, value.ToString());
 }
Example #21
0
 /// <summary>
 /// 执行设为粗体命令
 /// </summary>
 public static void Bold(this HtmlDocument document)
 {
     document.ExecuteCommand("Bold", false, null);
 }
Example #22
0
 /// <summary>
 /// 设置文档选区文字的背景色
 /// </summary>
 public static void SetLineColor(this HtmlDocument document, Color value)
 {
     document.ExecuteCommand("BackColor", false, string.Format("#{0:X2}{1:X2}{2:X2}", value.R, value.G, value.B));
 }
Example #23
0
 /// <summary>
 /// 执行设为斜体命令
 /// </summary>
 public static void Italic(this HtmlDocument document)
 {
     document.ExecuteCommand("Italic", false, null);
 }
Example #24
0
 /// <summary>
 /// 是否是两端对齐
 /// </summary>
 public static bool IsJustifyFull(this HtmlDocument document)
 {
     return(document.QueryCommandState("JustifyFull"));
 }
Example #25
0
 /// <summary>
 /// 是否是粗体
 /// </summary>
 public static bool IsBold(this HtmlDocument document)
 {
     return(document.QueryCommandState("Bold"));
 }