Search code examples
c#phphtmlwysiwygdreamweaver

C# wysiwyg editor for a custom language


I need to build a visual editor in C#. Given a piece of PHP and/or HTML code, the software will display them in the form of an editable webpage. At the same time it will display a dialog box from where the user should be able to edit options for the selected component. It is pretty like Adobe Dreamweaver's HTML editor but it needs to have the added functionality of handling PHP in it. (Dreamweaver parses HTML and just allows PHP segments while this program has to parse HTML as well as PHP).

I can build the dialog box stuff with functionality but my biggest problem is to create the WYSIWYG editor. Any suggestions/comments where I should start from?

Thanks in advance.


UPDATE

Basically it has to parse only a (very) small subset of PHP functions. Plus it has to parse some custom hard-coded functions. An example to parse out would be:

html here
...
...
<php echo $this->input(option1, option2, option3); ?>
...
more html here

This would show GUI to display a form field as it would show up in a browser. Similarly there will be some other functions (less than 150) that need to be parsed out. Other built-in PHP functions don't need to be parsed except some string manipulation functions.


Solution

  • Take a look at TinyMCE. It's a javascript WYSIWYG editor, and supports plugins and customizations. There seems to be a php plugin availble as well on SourceForge.

    If you want this in a WinForm or WPF app, you can embed it thru the WebBrowser control available.

    [Edit: Rich Text Control]

    You might can build on the code from this CodeProject. It extends the richtech box. Also check out ModelText for winform which says it can parse HTML (created by https://stackoverflow.com/users/49942/chrisw). Not sure if it's extensible though.