SharpDevelop

Copyright © 2001, 2002 SharpDevelop Community

Table of Contents

Welcome to SharpDevelop!
1. Getting Started with SharpDevelop
1. Introduction
2. SharpDevelop IDE
2.1. #develop Scouts
2.2. Code Window
2.3. Task List
2.4. Output
3. C# and SharpDevelop
3.1. Your First C# Project: Hello, World
3.2. Fixing Errors (C#)
4. VB.NET and SharpDevelop
4.1. Your First VB.NET Project: Hello, World
4.2. Fixing Errors (VB.NET)
2. Working with SharpDevelop
1. Introduction
2. Projects
2.1. Projects
2.2. Creating new projects
2.3. Project Templates
2.4. Project options
2.5. Building projects
2.6. Running projects
2.7. Deploying projects
2.8. Generating Documentation
3. Files
3.1. Introduction
3.2. Creating new files
3.3. File Templates
3.4. File Wizards
3.5. Adding Existing Files
3.6. Editing Files
3.7. Including/Excluding Files from Compilation/Deployment
4. Folders
4.1. Creating a Folder
4.2. Moving items between Folders
5. References
5.1. Adding a Reference
5.2. Removing a Reference
6. Combines
6.1. Combine
6.2. Combine Options
7. IDE Options
7.1. SharpDevelop Options
7.2. Coding
7.3. Text Editor
7.4. Tools
8. Text Libraries
3. Unit Testing
1. #Unit Introduction
1.1. Using #Unit
4. Extending SharpDevelop
1. Introduction
2. Creating a File Wizard
5. Walkthroughs
1. Introduction
2. Walkthrough: Creating a File Wizard
2.1. Interfaces you should know
2.2. The File Wizard definition Xml
2.3. Example File Wizard
3. Walkthrough: Creating a Project Wizard
3.1. Interfaces you should know
3.2. The Project Wizard definition Xml
3.3. Example Project Wizard
4. Walkthrough: Unit Testing
4.1. Writing Unit Tests
4.2. How to Start the Test
4.3. Compatibility
6. Samples
1. Introduction
2. Codon Creation
3. Custom IView Content
4. Display Bindings Sample
5. Language Bindings
6. Pad Content Sample
7. SharpPad
7. References
1. Shortcut Keys
A. Appendix
1. HOWTO: Build the Help
1.1. About the Technologies
1.2. Help Shopping List

List of Tables

2.1. Project Templates
2.2. File Templates
2.3. Text Library Groups
7.1. Clipboard Keys
7.2. Selection Keys
7.3. Completion Keys
7.4. Miscellaneous Keys


Welcome to SharpDevelop!

Thank you for choosing SharpDevelop as your development environment for .NET. SharpDevelop is a state of the art development enviroment, written from scratch using nothing but .NET itself - even the C# source code is available to you, allowing you to see the possibilities offered by .NET.

These are some of the main features of SharpDevelop:

  • Powerful project management via combines and projects
  • Syntax highlighting for many different programming languages
  • Integration with CVS for source code control
  • Code Completion for C#
  • Project support for many different languages, extensible for your needs

Please note that SharpDevelop is a work in progress. Visit our Web site regularly to learn about updates, suggest features, contribute code and inform us about problems you have encountered.

Thank you, the SharpDevelop Team.


Chapter 1. Getting Started with SharpDevelop

Table of Contents

1. Introduction
2. SharpDevelop IDE
2.1. #develop Scouts
2.2. Code Window
2.3. Task List
2.4. Output
3. C# and SharpDevelop
3.1. Your First C# Project: Hello, World
3.2. Fixing Errors (C#)
4. VB.NET and SharpDevelop
4.1. Your First VB.NET Project: Hello, World
4.2. Fixing Errors (VB.NET)


1. Introduction

For those who want to start working with SharpDevelop immediately, this is the place to start. This chapter gives you a quick guided tour of the application, and is designed to help you use SharpDevelop efficiently as quickly as possible.

This section includes:

  • A tour of the IDE
  • Quick-start examples
  • Links to further information

Tip

#develop uses the terms "Combine" and "Project". Briefly, a Project is a collection or source files (i.e. code) and other resources (such as images, icons, etc.) that can be compiled into a .NET Assembly. A "Combine" is a collection (a 'combination') of one or more Projects.


2. SharpDevelop IDE

Table of Contents

2.1. #develop Scouts
2.2. Code Window
2.3. Task List
2.4. Output

SharpDevelop (#develop for short) by default starts without open projects, allowing you to start programming straight away. The following screenshot shows the IDE, and highlights important parts of the user interface.

  1. Your open Combine, with the Projects and files
  2. Tabs to quickly select different Scouts
  3. The code editor window
  4. Tabs to select open files
  5. Output from your last compilation
  6. Tabs to change between Task List view and Compiler Output


2.1. #develop Scouts

Scouts are designed to provide different logical views of your project. Several Scouts provided with #develop


2.1.1. Projects Scout

The projects scout displays all files, folders and resources for your combine. Each project in your combine is displayed, and you can drill down to view all the contents of a project.

The projects scout also provides context menus for items within the scout. Right-click on an item to view its content menu.


2.1.2. Classes Scout

The classes scout provides a navigable tree of your current object hierarchy. Classes, functions, methods and parameters are available to be viewed.


2.1.3. Files Scout

The file scout provides access to the filesystem from within #develop. Use the file scout to navigate the folder structure and open files for viewing.


2.1.4. Tools Scout

The tools scouts allows you to insert blocks of text from predefined lists directly into your code.

To insert text into your code:

  1. Drag the text from the Tools Scout you wish to insert, and drop the text into your code window. The text will be inserted at the cursor.


2.1.5. Help Scout

The Help scout provides direct access to the #develop help system. Use the Help Scout to navigate the help contents, and double-click on an article to view it.


2.1.6. Properties Scout

The properties scout allows you to view and change properties for your windows forms and controls.


2.2. Code Window

The Code Window allows you to view and edit code in your Project. The code window provides a number of advanced editing options. See the section on Editing Files for more information.


2.3. Task List

The task list displays your current list of debug tasks. When your application is compiled, and errors and warnings are automatically displayed in the tasks scout. Double-click on a task to be taken directly to the corresponding code.


2.4. Output

The Output window displays output from your previous build(s).


3. C# and SharpDevelop

Table of Contents

3.1. Your First C# Project: Hello, World
3.2. Fixing Errors (C#)

This section will help you get started developing C# applications using #develop.


3.1. Your First C# Project: Hello, World

To introduce you to some of #develop's features, we'll create the classic example program - "Hello, World". This example will be written using the C# language.

To create the new program:

  1. Select the File, New Project... menu:

  2. From the new project screen, select the C# category on the left, and choose the "Windows forms project" template. Type a name for your new project (MyHelloWorld), and select a Location:

    Tip

    #develop can automatically create a project and source directory for you. Just tick the checkboxes in the new project dialog.

  3. #develop creates a default set of files for your new project. You can view all the files it creates by expanding the Combine and Project in the Project Scout at the left-hand side of the IDE, and double-clicking the individual files. For now, double-click the MainForm.cs file. This will open the file in the right-hand area of the IDE and allow you to view and edit the code.

  4. Now let's enter the code to show a messagebox with our standard text message: "Hello, World!". Type the following code into the MainForm declaration:

    MessageBox.Show("Hello, World!");

    Your MainForm.cs should look like this (the inserted code is highlighted):

  5. OK, let's build our solution and see if we typed the line correctly! Select the Run menu, and Build

    Tip

    Hotkey: F8 to Build your Combine

  6. Check the results of your Build in the Output window in the bottom-right corner of the #develop IDE.

  7. Everything looks OK! Lets run our program using the "Run" menu's "Run" item:

    Tip

    Hotkey: F5 to Run your Combine

  8. Success!


3.2. Fixing Errors (C#)

#develop provides integrated error-trapping and will help you to find and fix errors in your code.

#develop will highlight errors returned from the compiler in your code, and add a task in your Tasks list to help you find where the error occurred. We'll use the previous "Hello, World!" example to illustrate the error- highlighting options in #develop.

  1. Using our existing combine, delete the "M" in Messagebox:

  2. Now we'll rebuild the combine by selecting the Run menu, Re-build Combine option:

    Tip

    Hotkey: ALT-F8 to Rebuild your combine

  3. #develop compiles your program, and automatically adds errors and warnings to your task list. To go to the code that caused your error, click on a task from the list:

  4. Fix your error by replacing the "M" (don't forget its should be a CAPITAL M!) and Rebuild your Combine. The program should compile successfully, and you can run it to make sure.


4. VB.NET and SharpDevelop

Table of Contents

4.1. Your First VB.NET Project: Hello, World
4.2. Fixing Errors (VB.NET)

This section will help you get started developing VB.NET applications using #develop.


4.1. Your First VB.NET Project: Hello, World

To introduce you to some of #develop's features, we'll create the classic example program - "Hello, World". This example will be written using the VB.NET language.

To create the new program:

  1. Select the File, New Project... menu:

  2. From the new project screen, select the VBNET category on the left, and choose the VB forms application template. Type a name for your new project (MyHelloWorldVB), and select a Location:

    Tip

    #develop can automatically create a project and source directory for you. Just tick the checkboxes in the new project dialog.

  3. #develop creates a default set of files for your new project. You can view all the files it creates by expanding the Combine and ??? in the Project Scout at the left-hand side of the IDE, and double-clicking the individual files. For now, double-click the MainForm.vb file. This will open the file in the right-hand area of the IDE and allow you to view and edit the code.

  4. Now let's enter the code to show a messagebox with our standard text message: "Hello, World!". Type the following code into the Public Sub New declaration:

    MessageBox.Show("Hello, World!")

    Your MainForm.vb should look like this (the inserted code is selected):

  5. OK, let's build our solution and see if we typed the line correctly! Select the Run menu, and Build Combine

    Tip

    Hotkey: F8 to Build your Combine

  6. Check the results of your Build in the Output window in the bottom-right corner of the #develop IDE.

  7. Everything looks OK! Lets run our program using the Run menu's Run item:

    Tip

    Hotkey: F5 to Run your Combine

  8. Success!


4.2. Fixing Errors (VB.NET)

#develop provides integrated error-trapping and will help you to find and fix errors in your code.

#develop will highlight errors returned from the compiler in your code, and add a task in your Tasks list to help you find where the error occurred. We'll use the previous "Hello, World!" example to illustrate the error- highlighting options in #develop.

  1. Using our existing combine, delete the "M" in Messagebox:

  2. Now we'll rebuild the combine by selecting the "Run" menu, "Re-build" option:

    Tip

    Hotkey: ALT-F8 to Rebuild your combine

  3. #develop compiles your program, and automatically adds errors and warnings to your task list. To go to the code that caused your error, click on a task from the list:

  4. Fix your error by replacing the "M" (don't forget its should be a CAPITAL M!) and Rebuild your Combine. The program should compile successfully, and you can run it to make sure.


Chapter 2. Working with SharpDevelop

Table of Contents

1. Introduction
2. Projects
2.1. Projects
2.2. Creating new projects
2.3. Project Templates
2.4. Project options
2.5. Building projects
2.6. Running projects
2.7. Deploying projects
2.8. Generating Documentation
3. Files
3.1. Introduction
3.2. Creating new files
3.3. File Templates
3.4. File Wizards
3.5. Adding Existing Files
3.6. Editing Files
3.7. Including/Excluding Files from Compilation/Deployment
4. Folders
4.1. Creating a Folder
4.2. Moving items between Folders
5. References
5.1. Adding a Reference
5.2. Removing a Reference
6. Combines
6.1. Combine
6.2. Combine Options
7. IDE Options
7.1. SharpDevelop Options
7.2. Coding
7.3. Text Editor
7.4. Tools
8. Text Libraries


1. Introduction

This section describes standard usage of #develop.

This section includes:

  • Working with Projects and Combines
  • Managing your Projects
  • Code templates
  • #develop Options
  • Text libraries


2. Projects

Table of Contents

2.1. Projects
2.2. Creating new projects
2.3. Project Templates
2.4. Project options
2.5. Building projects
2.6. Running projects
2.7. Deploying projects
2.8. Generating Documentation


2.1. Projects

Projects are collections of folders, files and resources that can be compiled into your application.

Tip

Use the Projects Scout to view all the items in your project.


2.2. Creating new projects

New Projects can be created from the file menu of the #develop IDE.

To create a new Project:

  1. Select the File menu, New, Project... item

  2. Select the type of project you would like to create from the list of Project Templates

  3. Type a name for your project and select the location your project files will be created. #develop can also create a project subdirectory and sources subdirectory for you automatically by ticking the checkboxes in the dialog.

Tip

You can also create a new project by right-clicking on your Combine and selecting the Add, Add new Project... menu item.


2.3. Project Templates

#develop provides several different types of projects you can create. Each project type is a template that will automatically generate the appropriate default files and settings for your new project.

The following table lists the individual project types available.

Table 2.1. Project Templates

Category | Template | Description
C# | Console project | Creates a console C# project
 | Empty C# console project | Creates an empty C# console project
 | Empty C# Windows application | Creates an empty C# Windows application
 | Windows forms project | Creates a windows form project
Java | Empty java project | Creates an empty java project
 | Java AWT Application project | Creates a windows forms project
SharpDevelop | Blank combine | Creates an empty Combine
VBNET | Empty VB project | creates an empty VB project
 | VB forms application | creates an empty Windows Forms application in VB.NET


2.4. Project options

#develop offers you enhanced control over your project, the name and description of your project, code generation, how it will compile, and deployment options. You access the project options by selecting the Project menu, Project options... item.

Your Project Type

Different project types (i.e. C#, VB.NET, etc.) can have different options. Make sure you are referring to the correct tab based on your project type!


2.4.1. General, Project Options

The Project Options page provides access to standard project properties.

2.4.1.1. Name

Set the name of your project.

2.4.1.2. Description

Add a description for your project.

2.4.1.3. Project Documentation

Set the source for the project documentation file.

2.4.1.4. Auto-Find Files

#develop can automatically look for new files that have been placed in the same directory as your project. You can then select which files you want to include.

Tick the Automatically include new files box to have #develop include the files in your project automatically.

2.4.1.5. Enable Viewstate

???


2.4.2. Deploy, Compile

2.4.2.1. Include files in compile run

List of files to include in the compilation of the Project. Remove the tick next to any files you do not want compiled.


2.4.3. Deploy, Deploy

The deployment options allow you to specify how and where you would like your project deployed.

2.4.3.1. Deploy
2.4.3.1.1. Project files

Tick the project files you would like to deploy. Each selected file will be copied to your deployment folder.

2.4.3.1.2. Compilation target

Specifies that the compiled application should be copied to the deployment folder.

2.4.3.1.3. With scriptfile

Use a scriptfile to perform the deployment. A scriptfile allows for more advanced customisation of the deployment, such as directory creation and deletion.

2.4.3.2. Deploy target

The folder you want the deployed application files placed.


2.4.4. Configurations, Settings (C#)

2.4.4.1. Code Generation and Warnings
2.4.4.1.1. Compile Target

Select what type of program the project should be compiled to: Exe, WinExe, or Library

2.4.4.1.2. Define Symbols

Extra compiler command-line directives i.e. /DEBUG

2.4.4.1.3. Main class

The starting Class for the application.

2.4.4.1.4. Win32Icon

A path and file link to the Project's icon for a Win32 application.

2.4.4.1.5. Generate overflow checks

2.4.4.1.6. Allow 'unsafe' code

2.4.4.1.7. Treat warnings as errors

2.4.4.1.8. Enable optimizations

2.4.4.1.9. Emit debugging information

2.4.4.1.10. Generate xml documentation

2.4.4.1.11. Warning level

2.4.4.2. Output
2.4.4.2.1. Assembly name

The name for the assembly

2.4.4.2.2. Output path

Directory to compile the Project to.


2.4.5. Configurations, Settings (VB.NET)

Please Note

See the C# Project Option Settings for information on settings common to all projects.

2.4.5.1. Imports

A list of imports for your project.


2.4.6. Configurations, Runtime/Compiler

2.4.6.1. Runtime
2.4.6.1.1. Microsoft .NET

2.4.6.1.2. Mono

2.4.6.1.3. Mono Runtime Interpreter

2.4.6.2. Compiler
2.4.6.2.1. Microsoft csc
2.4.6.2.2. Mono mcs


2.5. Building projects

To build your Project, select the Run->Build (YourProjectName) (F8) menu item. This will start the Build process for your project.

You can also use the project context menu by right-clicking on your project and selecting Build (YourProjectName) .


2.6. Running projects

To run your project, select the Run->Run (F5) menu item.

Tip

You can change your startup project using the Combine Startup Properties


2.7. Deploying projects

You can configure #develop to deploy your application and its files to an area of your choice. To deploy your project:

  1. Configure your deployment options using the Deployment Options

  2. Select the Project->Deploy menu item. Your project will be deployed according to its deployment settings.

You can also start the deploy process by right-clicking on your project and selecting Deploy


2.8. Generating Documentation

To generate documentation for your project using NDoc:

  1. Right-click your project and select the Generate Documentation menu item.


3. Files

Table of Contents

3.1. Introduction
3.2. Creating new files
3.3. File Templates
3.4. File Wizards
3.5. Adding Existing Files
3.6. Editing Files
3.7. Including/Excluding Files from Compilation/Deployment


3.1. Introduction

#develop allows you to create and edit many different files types within the one environment.

#develop provides a number of File Templates that can help you quickly create files for your Project.

Tip

Your project can be configured to automatically include new files that are added to the file system where your project is located. See the Auto-Find Files for more details.


3.2. Creating new files

New files can be created from the file menu of the #develop IDE.

To create a new file:

  1. Select the File->New File (Ctrl-N) menu item:

    Tip

    You can also create a new file by right-clicking on your Project and selecting Add->New File

  2. Select the type of file you would like to create from the list of File Templates and click OK.

    Note:

    Selecting some File Templates will start up the associated File Wizard and ask you a set of questions to help create a more customised file.

  3. Type in the name of your new file and press enter.


3.3. File Templates

File templates are #develop-supplied templates that allow you to quickly create new files. The following table lists the file templates that are available.

Table 2.2. File Templates

Category | Template | Description
C# | Empty C# file | Creates an empty C# file
 | New class wizard | Creates the skeleton of a new C# class
 | Typed C# collection | Creates a typed C# collection
Java | Empty java file | Creates an empty java file
 | Java AWT Applect | A basic Java applet
 | Java AWT Application |
 | Java AWT Dialog |
 | Java AWT Frame |
 | Java AWT OK Dialog | Java AWT Panel
Misc | Empty HTML File |
 | Empty resource file |
 | Empty text file |
 | Empty XML file |
VB | Empty VB file |
 | New Class Wizard |
 | Typed VB collection |
Web Services | C# Web Service |
 | Secure C# Web Service (Session State) |
 | Secure VB.NET Web Service (Session State) |
 | VB.NET Web Service (Bare Bones) |
XmlForm | Xml Form | Creats an empty Xml Form
 | Xml UserControl | Creates an empty Xml user control


3.4. File Wizards

#develop includes File Wizards that will help you generate a customised file. There are a number of file wizards provided with #develop, and you can also Create a File Wizard.

File wizards appear after you have selected a file with an associated wizard. The wizard starts automatically and steps you through the process of creating a file. Typically the wizard automatically generates your file and adds customised code based on the answers you supplied. The wizard will then exit, and your new file will be ready to use.

The following screenshot shows the file wizard for the Typed Collection file.


3.5. Adding Existing Files

You can add existing files to your project. To add existing files:

  1. Right-click your Project and select the Add->Add Files

  2. Use the file open dialog to locate the files you wish to add and click OK.


3.6. Editing Files

#develop provides advanced editing functionality, and you can edit a wide range of file types from within the IDE. #develop also supports extendable syntax highlighting.


3.6.1. Opening Files for Editing

To open a file for editing, double-click the file in the Projects Scout. The file will be opened in the Code Editor window.


3.6.2. Code Editor

All editing within #develop is performed using the code editor window. The editor window provides advanced functions that allow you to quickly find, edit and replace text.

3.6.2.1. File Mode

#develop can recognise text content based on the file mode. The editor automatically highlights text (syntax highlighting), dependent on the current file mode being used.

For example, if the file mode is set to C# while editing a C# file, functions, parameters, text, comments, etc. will be highlighted to distinguish them from other text. This can help while editing code, as it enhances readability.

To change the current file mode:

  1. Right-click the code window and select the file mode from the menu File mode

The editor will automatically highlight and format your code to match the file mode setting.


3.7. Including/Excluding Files from Compilation/Deployment

#develop offers advanced inclusion and exclusion management for files within your projects. You can use either the Project Options Compile to select which files to include, or use the file context menu as follows:

  1. Right-click the file you wish to modify the compilation and deployment rules for, and select the Include menu item:

  2. Select (or deselect) the configurations you want this file included or excluded in. For example, if you want the file to be deployed only, de-select the Include->Compile menu item.


4. Folders

Table of Contents

4.1. Creating a Folder
4.2. Moving items between Folders

#develop allows you to organise your files into folders.


4.1. Creating a Folder

To create a new folder in your Project:

  1. Right-click your project (or another folder) and select Add->New Folder

  2. Type in the name of your new folder and press Enter:


4.2. Moving items between Folders

To move items or folders to another folder, drag and drop them onto another folder.


5. References

Table of Contents

5.1. Adding a Reference
5.2. Removing a Reference

#develop allows you to add references to your projects.


5.1. Adding a Reference

To add a reference to your project:

  1. Right-click on the References item in your Projects Scout and select Add Reference.

You can use the Add References dialog to add different types of references to your Project.


5.1.1. Adding a Global Assembly Cache (GAC) reference

To add a Global Assembly Cache (GAC) reference:

  1. Select the GAC tab

  2. Highlight one or more references from the list

  3. Click the Select button

  4. Click the OK button - #develop will add your selected references to your Project.


5.1.2. Adding a Project reference

To add a Project reference from the list of projects in your Combine:

  1. Select the Projects tab

  2. Highlight one or more projects from the list

  3. Click the Select button

  4. Click the OK button - #develop will add your selected references to your Project.


5.1.3. Adding a .NET Assembly reference

To add .NET Assembly reference:

  1. Select the .NET Assembly Browser tab

  2. Click the Browse button

  3. Use the file dialog to select the .NET Assemblies you want to reference and click OK

  4. Click the OK button - #develop will add your selected references to your Project.


5.2. Removing a Reference

To remove a reference from your Project:

  1. Right-click the reference you wish to remove and select Remove from the context menu


6. Combines

Table of Contents

6.1. Combine
6.2. Combine Options


6.1. Combine

Combines are super-projects, which contain other Projects. The purpose of this architecture is to group all projects together that are involved in your application: the dll assemblies, the Web site project and application projects. SharpDevelop is itself managed as a multi-project combine:


6.2. Combine Options

There are several options available to help you configure your combine.

To access the options, right-click your combine and select Combine Options


6.2.1. Common, Startup Properties

6.2.1.1. Startup Project(s)

Select between a single startup project, and one or more startup projects to being when you run your combine.


6.2.2. Common, Dependencies

6.2.2.1. Setting Project Dependencies

To select which projects depend on other projects:

  1. Select the project in the drop-down you want to change dependency information for.

  2. Tick the projects that your selected project depends on.


6.2.3. Configuration, Configurations

6.2.3.1. Combine configuration

6.2.3.2. Configuration Manager

6.2.3.3. Configuration Entries

6.2.3.4. Entry configuration


7. IDE Options

Table of Contents

7.1. SharpDevelop Options
7.2. Coding
7.3. Text Editor
7.4. Tools

#develop provides a number of different options to enable you to customise the way you work with #develop. The options are divided into several categories.


7.1. SharpDevelop Options


7.1.1. UI Language

SharpDevelop uses English as the default lanugage. You can change the UI language as follows:

  1. Select the Tools->Options menu item. This opens the Options dialog box shown below:

  2. To select a different language, click on the flag icon corresponding to your preferred language. Your choice is reflected in UI language set to:, next to the "Current UI language".

  3. Click OK to close the Options dialog box.

  4. Close SharpDevelop and re-open it (language changes are not reflected immediately, a restart is necessary)

7.1.1.1. Installing Language Packs

If after the release of SharpDevelop additional UI languages become available, these will be distributed via so-called language packs. Each language pack ships with a PDF document describing the installation procedure.


7.1.2. Visual Style

You can switch the menu style of SharpDevelop to one of the following three options:

  1. Visual Studio.NET menu style (default);
  2. Office 2000 menu style; or
  3. Standard Windows

To change the menu style, follow these steps:

  1. Select the Tools->Options menu item. This opens the Options dialog box. Switch to the Menu Style option panel:

  2. The options are selected via a radio button group. Images next to the option show you the visual effect of your choice.

  3. Click OK to close the dialog box.

  4. Restart SharpDevelop for the changes to take effect.


7.1.3. Load/Save Options

#develop allows you to change settings for files when they are loaded or saved.

7.1.3.1. Load
7.1.3.1.1. Load user-specific settings with the document

???

7.1.3.2. Save
7.1.3.2.1. Always create backup copy

Each save, a backup copy is made for the file.

7.1.3.2.2. Line terminator style

Allows you to change the style of line terminator, depending on the current platform.

  1. Macintosh

  2. Unix

  3. Windows


7.2. Coding


7.2.1. Code Templates

Code templates allow you to insert custom code by typing in a text "shortcut". #develop can then insert your custom code in place of your shortcut To use the code templates, type the shortcut word for the template and press Ctrl+J . Your text will be replaced with the code template text.

You can access the code templates by selecting the Tools->Options item . In the Options dialog, select the Coding, Code Templates category. This will display the following dialog:

7.2.1.1. Adding a Code Template

To add a code template:

  1. Click the Add button to access the Edit Template dialog

  2. Enter a name and description for your template and click OK

  3. Add the code you want to have substituted for your shortcut word, and click OK

7.2.1.2. Editing a Code Template

To edit the code template's name and description:

  1. Select the code template to be modified, and click the Change button

  2. Update the name and description

  3. Click the OK button

To edit the code template's replacement text:

  1. Select the code template to be modified

  2. Update the text to be inserted

  3. Click the OK button

7.2.1.3. Deleting a Code Template

To remove a code template:

  1. Select the code template to be removed

  2. Click the Remove button


7.3. Text Editor


7.3.1. General

7.3.1.1. General Options
7.3.1.1.1. Enable code completion
7.3.1.1.2. Enable doublebuffering
7.3.1.1.3. Enable folding
7.3.1.2. Font
7.3.1.2.1. Textfont

Select the font you want text to display in

7.3.1.2.2. Render font antialiased


7.3.2. Markers and Rulers

7.3.2.1. Show horizontal ruler

Displays a horizontal ruler. Enter the row you want the ruler to display at.

7.3.2.2. Show vertical ruler
7.3.2.3. Line marker style

Select "Full row" to highlight the entire row the cursor is currently on

7.3.2.4. Show line numbers
7.3.2.5. Underline errors
7.3.2.6. Highlight matching bracket
7.3.2.7. Show invalid lines
7.3.2.8. Show EOL markers
7.3.2.9. Show spaces
7.3.2.10. Show tabs


7.3.3. Behaviour

7.3.3.1. Tabs
7.3.3.1.1. Tab size
7.3.3.1.2. Indentation
7.3.3.1.3. Indentation size
7.3.3.1.4. Insert spaces/Keep tabs
7.3.3.2. Behaviour
7.3.3.2.1. Can move caret behind EOL
7.3.3.2.2. Automatic template insertion
7.3.3.2.3. Auto insert curly braces
7.3.3.2.4. Hide mouse cursor while typing
7.3.3.2.5. Mousewheel direction

Select between Normal scroll and Reverse scroll direction


7.4. Tools


7.4.1. External Tools

The External Tools option allows you to add your own custom tools to the #develop IDE Tools menu. You can add additional configuration items to the starting of your external tool as well.

7.4.1.1. Adding an External Tool

To add an external tool:

  1. Select the Tools->Options... menu item and change to the Tools, External Tools category:

  2. Click the Add button to add a new tool. This name of the tool defaults to New Tool.

  3. Select your newly added item, and the properties for the item will be displayed:

  4. Set the properties of your external tool as follows:

    Arguments: Arguments to start your tool with

    Command: The path to your tool (no jokes please... :)

    InitialDirectory: The initial (startup) directory

    MenuCommand: The text for the menu command. You can use the "&" character to get #develop to underline letters in your command.

    PromptForArguments: #develop can prompt you for arguments to pass to the external tool.

7.4.1.2. Deleting an External Tool

To delete an external tool from the list, highlight the tool you wish to remove and click the Remove button.


8. Text Libraries

Text libraries allow you to insert blocks of pre-written text directly into your code. Using the Tools Scout, you can insert a block of text from the list.

The following groups of text libraries are available:

Table 2.3. Text Library Groups

Category | Description
ASCII Table | List of ASCII characters and their values
C# Documentation Tags | C# documentation tags
Licenses | A variety of public license definitions
General |
Clipboard Ring | A list of previous clipboard entries


Chapter 3. Unit Testing

Table of Contents

1. #Unit Introduction
1.1. Using #Unit

#develop provides a customised unit testing application called #Unit. #unit allows you to develop your own application test cases and run them against your projects.


1. #Unit Introduction

Table of Contents

1.1. Using #Unit

SharpUnit (or #Unit for short) is a unit test suite for the .NET platform providing the following functionality:

  1. SharpUnit provides an easy to use powerful testing framework for developers.

  2. Tests can be written in any language running under .NET

  3. SharpUnit provides an easy to use GUI

  4. A test manifest file for assemblies can be written for assemblies depending on other assemblies which are not located in the directory currently being tested

  5. Unit tests can be built without requiring special inheritance, therefore protected members of classes can be tested

  6. The GUI will release the test assemblies when all tests are completed and will reload them before the next run. Therefore #Unit won't 'lock' your assemblies.


1.1. Using #Unit

To access the #Unit application from #develop, select the Tools->#Unit menu item. This will open the #Unit GUI.

To find out more information about using #Unit, read the ReadMe.sxw (OpenOffice) file.


Chapter 4. Extending SharpDevelop

Table of Contents

1. Introduction
2. Creating a File Wizard


1. Introduction

This section describes how you can extend the capabilities of #develop.


2. Creating a File Wizard

A file wizard steps a user through the process of creating a file by prompting for different information. The wizard then creates a customised file matching the user's preferences. For more information about file wizards, see the File Wizard section.

For information on how to create a file wizard, see the following section: Walkthrough: Creating a File Wizard.


Chapter 5. Walkthroughs

Table of Contents

1. Introduction
2. Walkthrough: Creating a File Wizard
2.1. Interfaces you should know
2.2. The File Wizard definition Xml
2.3. Example File Wizard
3. Walkthrough: Creating a Project Wizard
3.1. Interfaces you should know
3.2. The Project Wizard definition Xml
3.3. Example Project Wizard
4. Walkthrough: Unit Testing
4.1. Writing Unit Tests
4.2. How to Start the Test
4.3. Compatibility


1. Introduction

This section provides several different walkthroughs for #develop.


2. Walkthrough: Creating a File Wizard

Table of Contents

2.1. Interfaces you should know
2.2. The File Wizard definition Xml
2.3. Example File Wizard

A file wizard creates user-configurable files on the fly (in contrast to File New templates). SharpDevelop allows to plugin custom file wizards which extend SharpDevelop. This walkthrough shows you how to create a custom file wizard.


2.1. Interfaces you should know

All file wizards have to implement this interface:

namespace SharpDevelop.Internal.Templates {
    public interface INewFileWizard
    {
        void StartWizard(Form mainWindow, INewFileCreator creator, string parameters);
    }
}

The mainWindow parameter is passed only for setting the Owner property of the wizard form correctly (and maybe for really advanced wizards to cast it to a MainWindow - and then gain full access to the SharpDevelop object model).

The second parameter is of interface type INewFileCreator:

namespace SharpDevelop.Internal.Templates {
    public interface INewFileCreator
    {
        bool IsFilenameAvailable(string fileName);
        void SaveFile(string filename, string content, string languageName, bool showFile);
    }
}

The StartWizard method receives an INewFileCreator object. Currently it is used for "writing" a file to the IDE. The languageName parameter has to be set correctly according to the language name, or the syntax highlighting won't work correctly.

The parameters string is the "optional" string which can be defined in the wizard's definition Xml (described in the next section). Reasoning: you can use one assembly which creates VB, C#, JScript ... code and give a parameter in the Xml template which defines which language to generate by this parameter.


2.2. The File Wizard definition Xml

<?xml version="1.0"?>
<Template Originator="Mike Krueger" Language="C#" Created="3/09/2001" LastModified="3/09/2001">
<TemplateConfiguration>
    <Name>Typed C# Collection</Name>
    <Icon>C#.File.CSFileIcon</Icon>
    <Category>C#</Category>
    <LanguageName>C#</LanguageName>
  <Description>creates an typed C# collection</Description>
    <Wizard dll = "CodeGenerator.dll" class = "TypedCollectionGenerator.WizardWindow" parameters ="C#"/>
</TemplateConfiguration>
<TemplateFiles/>
<FileOptions/>
</Template>

As you can see, this is almost an ordinary file template xml. Except it does not define a template file and it has a Wizard tag in the TemplateConfiguration node. The Wizard tag must have the attributes dll and class - the parameters attribute is optional. The parameters are given to the INewFileWizard object which will be of the type class. (Therefore class must inherit from INewFileWizard).


2.3. Example File Wizard

You can find a sample file wizard in the "src\Wizards\file\TypedCollection" directory.


3. Walkthrough: Creating a Project Wizard

Table of Contents

3.1. Interfaces you should know
3.2. The Project Wizard definition Xml
3.3. Example Project Wizard

A project wizard creates user configurable projects on the fly. SharpDevelop allows to plugin custom project wizards which extend SharpDevelop.


3.1. Interfaces you should know

All project wizards have to implement this interface :

namespace SharpDevelop.Internal.Templates {
    public interface INewProjectWizard
    {
                void StartWizard(Form mainWindow, INewProjectCreator creator);
    }
}

The mainWindow is only for setting the Owner property correctly (and maybe for really advanced wizards to cast it to a MainWindow).

public interface INewProjectCreator
{
    Combine Combine {
        get;
    }
    bool IsFilenameAvailable(string fileName);
    void SaveFile(IProject project, string filename, string content, bool showFile);
}


3.2. The Project Wizard definition Xml

???


3.3. Example Project Wizard

???


4. Walkthrough: Unit Testing

Table of Contents

4.1. Writing Unit Tests
4.2. How to Start the Test
4.3. Compatibility


4.1. Writing Unit Tests

For every class that you want to test, you have to write a "test suite", which is a class (eg *TestSuite) that inherits from TestCase. Define a static property Suite in this class, which returns a new ITest object (generally a TestSuite object). Now write the test methods - for standard's sake, they have Test in their names. (TestXyzTest). Add every method to the TestSuite object.

Example:

using System;
using TestingEnvironment.Framework;

using SharpDevelop.Tool.Function;

public class FileUtilityTestSuite : TestCase
{

    public FileUtilityTestSuite(string name) : base(name)
    {
    }

    public void TestAbsoluteToRelativePathTest()
    {
        AssertEquals(@".\b", FileUtility.AbsoluteToRelativePath(@"C:\test\a", @"C:\test\a\b"));
        AssertEquals(@"..\b", FileUtility.AbsoluteToRelativePath(@"C:\test\a", @"C:\test\b"));
        AssertEquals(@"D:\b", FileUtility.AbsoluteToRelativePath(@"C:\test\a", @"D:\b"));
        AssertEquals(@".\testme.exe", FileUtility.AbsoluteToRelativePath(@"C:\test\a", @"C:\test\a\testme.exe"));
    }

    public void TestRelativeToAbsolutePathTest()
    {
        AssertEquals(@"C:\test\a\b", FileUtility.RelativeToAbsolutePath(@"C:\test\a", @".\b"));
        AssertEquals(@"C:\test\b", FileUtility.RelativeToAbsolutePath(@"C:\test\a", @"..\b"));
        AssertEquals(@"D:\b", FileUtility.RelativeToAbsolutePath(@"C:\test\a", @"D:\b"));
        AssertEquals(@"C:\test\a\testme.exe", FileUtility.RelativeToAbsolutePath(@"C:\test\a", @".\testme.exe"));
    }

    public static ITest Suite {
        get {
            TestSuite suite = new TestSuite("My 1st Testsuite");
            suite.AddTest(new FileUtilityTestSuite("TestAbsoluteToRelativePathTest"));
            suite.AddTest(new FileUtilityTestSuite("TestRelativeToAbsolutePathTest"));
            return suite;
        }
    }
}


4.2. How to Start the Test

First you have to reference the TestingEnvironment.dll found in the SharpDevelop bin directory to your testing project (you could include the test classes in your main project, but I prefer to have it external.)

And then compile the project.

Now you have to run the tests. To start the tests, select the "Run Tests" menu item in the context menu.

Then the test environment GUI pops up:

Click on the Run button to run the tests you have choosen in the left treeview. You are informed of errors and failures. (btw. the bar turns red if an error occurs).


4.3. Compatibility

Generally SharpDevelop Test classes should be compatible to NUnit, as it was ported from JUnit too. Therefore you can look at the NUnit documentation for further information.


Chapter 6. Samples

Table of Contents

1. Introduction
2. Codon Creation
3. Custom IView Content
4. Display Bindings Sample
5. Language Bindings
6. Pad Content Sample
7. SharpPad


1. Introduction

This section documents some of the samples provided with #develop.

All samples are stored in the samples directory.


2. Codon Creation

The Codon Creation sample shows you how to create a codon for #develop.

The source for this sample can be found in \samples\CodonCreationExample. Refer to the CodonCreationExampleTechNote.sxw (OpenOffice) document that details the sample.


3. Custom IView Content

The IView content samples shows you how to create a view for #develop.

The source for this sample can be found in \samples\CustomIViewContent. Refer to the CustomIViewContent.sxw (OpenOffice) document that details the sample.


4. Display Bindings Sample

These samples show you how to create an Alternate Editor and a Tabbed Control.

The source for the samples can be found in \samples\DisplayBindings.


5. Language Bindings

The language binding tutorial guides you through the process of creating a functional language binding for SharpDevelop.

The source for this sample can be found in \samples\LanguageBindings. Refer to the LanguageBindingTutorial.sxw (OpenOffice) document that details the sample.


6. Pad Content Sample

This sample demonstrates how to create a #develop pad. A pad is a custom window that can extend #develop functionality, and can be "docked" or moved around the screen. For example, the #develop Scouts are all custom pads.

The source for this sample can be found in \samples\PadContentSample. Refer to the PadContentSampleTechNote.sxw (OpenOffice) document that details the sample.


7. SharpPad

This sample demonstrates how to create a #develop version of Notepad using the #develop text editor control.

The source for this sample can be found in \samples\SharpPad.


Chapter 7. References

Table of Contents

1. Shortcut Keys


1. Shortcut Keys

#develop provides the following shortcut keys.

Table 7.1. Clipboard Keys

Shortcut | Description
Ctrl-X, Shift+Del | Cut selection to clipboard
Ctrl+C, Ctrl+Ins | Copy selection to clipboard
Ctrl+V, Shift+Ins | Paste selection from clipboard in text

Table 7.2. Selection Keys

Shortcut | Description
Ctrl+A | Select whole buffer (file)

Table 7.3. Completion Keys

Shortcut | Description
Ctrl+J | Template complete / Open template completion window

Table 7.4. Miscellaneous Keys

Shortcut | Description
Ctrl+U | Reload buffer (file) from disk
Ctrl+I | Indent code section
Ctrl+B | Go to matching brace (if caret is over a bracket)
Ctrl+/ | Comment/Uncomment code section


Appendix A. Appendix

Table of Contents

1. HOWTO: Build the Help
1.1. About the Technologies
1.2. Help Shopping List


1. HOWTO: Build the Help

Table of Contents

1.1. About the Technologies
1.2. Help Shopping List

This section describes how to build the Help information, what technologies are involved, and where to get more information.


1.1. About the Technologies

The #develop help is based on the DocBook implementation. Briefly, DocBook is a presentation-neutral SGML/XML-based implementation that allows different document formats (such as HTML and XHTML) to be produced from the one source. For more information about the DocBook specification, consult DocBook: The Definitive Guide.

The source text is stored as Xml files, and using a set of XslT stylesheets, it can be converted into different document formats.

The images are saved as PNG format images.


1.2. Help Shopping List

To compile the help source files into something (hopefully) more usable, you should have the following programs:

  1. A copy of the help source files and images;

  2. Your favourite command-line XslT processor (Saxon is a very good cross-platform processor)

  3. The DocBook XML files - the currently used version is 4.2;

  4. The DocBook XslT files - the currently used version is 1.5.3;

  5. The Microsoft HTML Help Compiler (hhc.exe) if you plan on producing CHM files.