The following are some of the main features of C1Editor that you may find useful:
Bind the C1Editor control to a document specified in the Document property. If the document is edited within the C1Editor, the underlying XmlDocument syncs to match it. If the XmlDocument changes in code, these changes are visible in the C1Editor control at run time. See Binding C1Editor to a Document for more information.
The C1Editor control features three editor modes: Design, Source, and Preview. You can determine which of these views users will see initially by setting the Mode property. See the C1Editor Overview for more information.
You can load an XHTML document into C1Editor from a file, stream or XML string. You can save an XHTML document to a file or stream. See the Editor for WinForms Task-Based Help for examples on how to do this.
C1Editor fully supports cascading style sheets (CSS) in edited documents. In addition, you can specify external CSS rules in CSS files which will be used only in Design or Preview mode. The LoadDesignCSS and LoadPreviewCSS methods support this feature by loading a cascading style sheet from a file or stream.
See Using a Cascading Style Sheet with C1Editor for an example on using the LoadDesignCSS method.
On document loading, switching off Source mode, or on executing the ValidateSource or FixSource methods, C1Editor automatically removes empty tags, closes unclosed tags, and generally improves messy or unreadable HTML or XHTML code, converting it to valid XHTML.
Spell-checking functionality is provided by ComponentOne's C1SpellChecker component.
C1Editor fully supports C1SpellChecker so you can use all of its great features, including: modal Dialog mode (users can choose to correct or ignore errors through a dialog box), As-you-type mode (spelling errors are indicated by a red, wavy underline), and the AutoReplace feature (misspelled words are automatically corrected as you type). In As-you-type mode, the built-in C1Editor context menu merges with the C1SpellChecker context menu so you can see and select all available commands.
Advanced programming tasks sometimes require using additional DTD elements in the edited document. You can enter the elements, or tags, in the document specifying them using the XmlExtensions property in special XML format. See the CustomTags sample installed with this product for a complete example of this feature.
You can access content in the C1Editor by specifying a range of characters to select. For an example, see Selecting Characters in the C1Editor.
You can easily set font and text decoration and block formatting properties in a text block without worrying about how to modify the underlying XmlDocument. Use the C1TextRange class to identify target text and the C1TextRange methods to apply the decoration or formatting: ApplyTag, ApplyClass, ApplyStyle, and ApplyFormatting.
You can show built-in or custom dialog boxes to insert or edit various objects at the current selection. The dialog boxes allow you to specify all properties of the inserted or edited object. For example, the Picture dialog box contains fields to select the image source, or file name, alternate text, size, and so on. C1Editor also has a built-in Find and Replace dialog box that allows the user to specify a string to search for and a replacement string, as well as the options to use when searching for text in a document. If you prefer, you can create and use your own find and replace dialog box, specifying it in the CustomDialogs property of the C1Editor.
For more information on C1Editor's built-in dialog boxes, or for steps on how to use your own, see C1Editor Dialog Boxes.
You can interact with objects directly inDesignmode by specifying their size or position with the mouse.
Moving is a direct manipulation. You can move an object within a document in any direction. C1Editorwill move relative to the XmlNode and/or set the new position attributes of the object automatically.
Resizing allows you to resize the selected object in the direction of the mouse pointer movement. C1Editor will set the new size attributes of the object automatically.
Calling the Print method has the same effect as choosing Print from the Windows Internet Explorer File menu. The Print method can activate the Print dialog box, prompting the user to change print settings.
The PrintPreview method lets you see the Web page before you print it so you can avoid printing mistakes.
See the PrintTemplate sample installed with this product for a complete example of this feature.
You can select text, tables or graphics and use the Cut or Copy methods of C1Editor to move your selection to the Clipboard. Then you can paste the selection into another program. You can copy HTML from a program or even a picture in Internet Explorer and then use the Paste method to put it into the C1Editor.
The PasteAsText method automatically formats the text you paste into the C1Editor as plain text.
C1Editor also supports keyboard shortcuts such as CTRL+C (copy), CTRL+X (cut), and CTRL+V (paste).
To determine what clipboard operations are allowed, use the CanCut, CanCopy, CanPaste, and CanPasteAsText properties.
C1Editor has an unlimited undo history mechanism. You can programmatically access the editing history, calling the Undo or Redo methods. The Undo and Redo methods also support keyboard shortcuts: CTRL+Z (undo) and CTRL+Y (redo).
By undoing repeatedly, a user can gradually work back to the point before the error was made.