TimeGIS
InfoVista.NET
首页             技术文章             专业软件             管理软件             开源软件             知识分享             网站地图            

 程序开发

      图形编辑器

 开发工具


 Web应用开发


 手机移动开发


 建站系统


 企业应用


 服务器


 数据库


 应用工具


 游戏娱乐


 操作系统


 控制仿真



Windows WinForms HTML Editor sample in C# for Visual Studio 2010

参考:http://code.msdn.microsoft.com/windowsdesktop/WinForms-HTML-Editor-01dbce1a

WinForms HTML Editor

The purpose of the Html Editor is to provide Html Editing capabilities within a WinForms control. The control should emulate the operations that are available within a Rich Text control, but have information persisted and restored from an Html BODY element.

Html Editor Goals


The purpose of the Html Editor is to provide a control that allows for Html editing satisfying the requirements of input for rich text layouts and simple portal type information. Examples of the former are case where the Rich Text control would normally be utilized; documentation, complex descriptions where text formatting is required, correspondences, bulletins, etc. Examples of the latter case are such items as dashboards; news clips, announcements, company references, etc. These are defined by cases where complex layouts are required that may include images and links.


High level design goals are:

  1. Provides robust WYSIWYG editing capabilities whose contents are persisted in HTML format.
  2. Is easily reusable in other projects.
  3. Provides methods for saving HTML files to and loading files from disk (with the appropriate security demands).

The basic operations of the control are thus defined as:


Standard Text Editing

  1.  Support basic formatting commands such as Bold, Italic, Underline, Strikeout, Font Name, Font Size, Font Color, Justification (Left, Right, and Center), Bullets and Number Lists. Dialogs should be presented to the user for modifying Font and Color attributes.
  2. Provide for standard Cut, Copy, Paste, Undo, Redo, Select All, and commands.
  3. Allow for the inserting and removing indentation.
  4. Allow the inclusion of images along with alternative text and text alignment options.
  5. Allow for the insertion of web links (Anchor tags), including the definition of the target frame.
  6. Allow for the insertion of a horizontal line for text separation.
  7. Provide a Find and Replace mechanisms. This dialog should highlight the appropriate text upon a find, and support a Replace All operation.
  8. Provide an integrated toolbar to perform the standard text editing functions, and other essential functions (as listed in the above points).
  9. Allow for the Insert mode (overwrite), word wrapping options to be toggled, and the visibility of scroll bars to be defined.
  10. Allow the use of context menus that include all the required text formatting commands. The context menu should be sensitive to the user’s selection.
  11. Allow for the insert, removal, and property definition of tables.


Body Properties

  1. Have the ability to simply set the text of the document body, the inner text of an Html Document; a browsable designer property.
  2. Allow for the assignment of the complete Body element (Body outer Html), preserving and body properties. Also allow for the
    assignment of the Body contents, Body inner Html.
  3. Support the inclusion of Headings and Formatted blocks of text. This operation should be able to be performed in reverse; set to
    Normal style.
  4. Have the ability to define the default body background and foreground colors.
  5. Allow for the ability of the Html content to be viewed or edited directly.
  6. Allow for the pasting of Text and Html Markup.

External Behavior

  1. Allow a reference to a stylesheet to be applied to the document at runtime. The purpose is to allow the definition of a corporate wide stylesheet that all documents should reference for standardizing fonts, colors, etc.
  2. Allow a reference to a script source file to be applied to the document at runtime. The purpose is to allow the use of a corporate script file that can be used for handling links requiring programmatic redirection.
  3. Allow for the ability to ensure all links are forwarded to a new browser window; and not rendered within the window containing
    the original link.
  4. Allow a document to be loaded by a given URL.


HTML Editor Non Goals

The Html Editor is not designed to provide similar functionality to Html Editor Products. For complex layout requiring Styles, Absolute Positing, Frames, Multi-Media, etc, these products should be utilized.

Operations that the control does not support are thus defined as:

  1. Support is only included for a single Font selection and not Font Families.
  2. Support for 2D-Position, Absolute Position, and Live Resize is not included.
  3. Multiple Selections of items is not supported and all operations are based on a single selected control.
  4. Simple Font properties are used rather than style attributes. The inclusion of style attributes brings around complexity regarding the use of Span tags.
  5. There was the option to have the control be Tab driven; supporting Design, Edit Html, and Preview. This would then have made the control look more like a fully-functional Html editor rather than a replacement to the Rich Text Box.

Here is a complete set of documentation:

Html Editor Application.pdf

Here is the C# Public API

 


共107页  第94页  首页  上一页  下一页  尾页


友情链接 尚禹水利环境 | 我行我速 | SharpDevelop | CSLA.NET | CodePlex | 开源中国社区 | 流体中文网 | 水资讯网 | 上帝之眼 FindSim.NET |
本网页由快手工具软件自动生成,感兴趣者请联系我们。