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