Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Visual Studio 2013, you will be asked to select the project into which you want to INSTALL the NuGet package. Select Deltashell.Plugins.VolumeModel :

Complete the install by pressing ok. This may take a while because Nuget will now download the DeltaShell framework and runs If asked for confirmation, respond affirmatively to complete the installation of the packages. NuGet will now either contact the server and then download the Delta Shell framework package, or retrieve it from the local folder. Then, it will run the corresponding install scripts to configure your project for use as a deltashell pluginDelta Shell plugin. This whole process may take a while.

After installing the package your project will look something like this :

Remove

...

PostSharp from project

In this tutorial we don't use PostSharp because it needs a license. PostSharp is mostly used for automatically adding code for property and collection changed events and event bubbling.

To remove postsharp PostSharp do the following :

  1. Remove postsharp PostSharp reference and "RequiresPostSharp.cs" from the project (see the selected items in previous image)
  2. Open the packages.config and remove the postsharp PostSharp reference "<package id="PostSharp" version="2.1.7.28" targetFramework="net40" />"
  3. Unload the project (right click on project - Unload project)
    Edit project file (right click on project - Edit DeltaShell.Plugins.VolumeModel.csproj)
    Remove (near the end of the csproj) <Import Project="..\packages\PostSharp.2.1.7.28\tools\PostSharp.targets" Condition="Exists('..\packages\PostSharp.2.1.7.28\tools\PostSharp.targets')" />
    Load project

Set startup project

Start by building the project. This will copy DeltaShell to the bin folder next to your solution file (D:\VolumeModel\bin)
Now open the project properties and go to the debug page and change set the startup program to : D:\VolumeModel\bin\Debug\DeltaShell\DeltaShell.Gui.exe

...

Create an application plugin class

Add a class named "named VolumeModelApplicationPlugin " to the project and add the following code describing the application part of the plugin:

Code Block
using DelftTools.Shell.Core;
using Mono.Addins;

namespace DeltaShell.Plugins.VolumeModel
{
    [Extension(typeof(IPlugin))]
    public class VolumeModelApplicationPlugin : ApplicationPlugin
    {
        public override string Name
        {
            get { return "VolumeModelApplication"; }
        }
        public override string DisplayName
        {
            get { return "Volume model application"; }
        }
        public override string Description
        {
            get { return "Application plugin of the volume model application"; }
        }
        public override string Version
        {
            get { return "1.0"; }
        }
        public override string FileFormatVersion
        {
            get { return "1.0"; }
        }
    }
}

Created

...

a GUI plugin class

Create a class named "named VolumeModelGuiPlugin" to the project and add the following code describing Gui part of the plugin:

Add reference to DeltaShell Gui
Code Block
using DelftTools.Shell.Core;
using DelftTools.Shell.Gui;
using Mono.Addins;
namespace DeltaShell.Plugins.VolumeModel
{
    [Extension(typeof(IPlugin))]
    public class VolumeModelGuiPlugin : GuiPlugin
    {
        public override string Name
        {
            get { return "VolumeModelApplicationUI"; }
        }
        public override string DisplayName
        {
            get { return "Volume model application (UI)"; }
        }
        public override string Description
        {
            get { return "Gui plugin of the volume model application"; }
        }
        public override string Version
        {
            get { return "1.0"; }
        }
        public override string FileFormatVersion
        {
            get { return "1.0"; }
        }
    }
}
Note
title

 

To get the code above to work, we need to add a reference to DelftTools.Shell.Gui

...

in the project.

Image Added

 

The dll referred to can be found in the folder packages

...

of the project:

Image Added

 

Note
titleAdd reference to DeltaShell Gui

Important: our project : .\packages\DeltaShell.Framework.1.1.1.34867\lib\net40\DeltaShellAlso set the copy local property of the DelftTools.Shell.Gui reference to false (the False. The DeltaShell framework will have already copied it to the bin, so we do not need to copy the "DelftTools.Shell.Gui.dll" to our plugin folder).

Exercise results

Run the application and open the Plugins window (File | Plugins ). Ensure both the application plugin and the gui plugin are visible in the overview of loaded plugins:

...