Before you can do syntax highlighting with C# files, you will need to obtain its syntax definition file, CSHARP.SYN. This is included with TextPad and can be downloaded from http://www.textpad.com/add-ons/syna2g.html. Follow the installation instructions at the bottom of that page, then:
- From the Configure menu, choose New Document Class. The Document Class Wizard is displayed.
- In the Document Class Name box, type C# and click Next.
- In the Class Members box, type *.cs and click Next.
- Tick the box to enable syntax highlighting.
- From the drop-down list, choose "csharp.syn" and click Next.
- Click Finish.
Add the C# compiler as a tool in TextPad
- From the Configure menu, choose Preferences. The Preferences dialog box is displayed.
- Select "Tools".
- Click Add, and choose the option "Program".
- Browse for CSC.EXE. It should be in a subfolder of your main Windows 2000 installation folder, named "ComPlus\v2000.14.1812"
- Optionally rename the tool by clicking it twice, slower than double click speed, and typing C#;. You may insert an "&" before the character you want to use as a menu mnemonic.
- If necessary, click the up arrow to move the new tool to the required position on the menu.
- Click OK.
Add a filter for C# files to the Open dialog box
- From the Configure menu, choose Preferences. The Preferences dialog box is displayed.
- Select "File Name Filters".
- Click New.
- Change the description to C#.
- Type *.cs, in the wild cards box.
- If necessary, click Move Up, to move the filter to the required position.
- Click OK.
Test it all works
No point in starting with anything complicated, so try Hello World at this stage:
- From the File menu, select Open and set Files of Type to C#.
- Browse for Hello.cs in NGWSSDK\Samples\Deployment\1_HelloWorld, and click Open
- Check that comments are displayed in green and keywords in blue.
- From the Tools menu, select C#.
- Check that the Command Results shows "Tool completed successfully", then close that window.
- From the Tools menu, select Run. The Run dialog box is displayed.
- In the Command box, type Hello.exe and click OK.
- Check that a console window is created, displaying "Hello World using C#!".
- Close the console window.
That's it!
extracted from - http://www.textpad.com/support/faq/csharp.html#syntax