views:

67

answers:

1

Hi,

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.

+1  A: 

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 http://stackoverflow.com/users/49942/chrisw). Not sure if it's extensible though.

Mikael Svenson
Would it be possible to use something similar to TinyMCE directly in WinForm (or WPF) without using form control? Because using it with WEbBrowser control will make the GUI which I won't be able to manipulate and prse. This will prevent me from working on other things (like dialog box, as I told in my question). Thanks for your time.
Muhammad Yasir
I revised my answer with a couple of more links to non-webcontrol approaches.
Mikael Svenson
Thank you so much for the great help. I'll start working on these... :)
Muhammad Yasir