logo

Creating new module in the designer

To create a new module:

1. Create an assembly or a folder within the assembly with the following structure:

NewModule

| - Constants // Contains constants with the names of the teams, events, workspaces, etc.

| - Controllers // Contains controllers

| - Models // Contains Object Model

| - Services // Contains interfaces and service implementations

| - Views // Contains views, controls, dialogs, wizards

| - WorkItems // Contains work items

2. Create a base work item of the module in the WorkItem folder 

public class NewModuleWI : RibbonChapterWorkItem<Controller, NewModuleView>
{
}

You can use either a standard or a custom class as a controller.

3. Create a view for the module.

It can be any WinForms control.

If we need to use a controller and/or a work item for the view, the controller can be inherited from ControlledView or ControlledDataView . The last one allows you to pass data through the DataSourceObject property.

To correctly display the designer view in VisualStudio, you should inherit from the stub class.

/// <summary>
/// View
/// </summary>
public partial class NewModuleView : NewModuleView_Generic
{
    // View logic
}/// <summary>
/// View stub
/// </summary>
public class NewModuleView_Generic : ControlledDataView<NewModuleController>
{
}

4. In the root folder, create a class inherited from SingleWorkItemModule<NewModuleWI>.

5. In the configuration file of the application, add a line with the module registration. 

<CompositeUI>
  <modules>
    <add type="EleWise.ELMA.NewModuleAsm.NewModule, EleWise.ELMA.NewModuleAsm"/>
  </modules>
</CompositeUI>