Add plug-in support

This commit is contained in:
2019-05-29 09:48:49 +02:00
parent 1f1cbfd1e5
commit 8847f3f9b7
7 changed files with 221 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
namespace VAR.Toolbox.TestPlugin
{
partial class FrmTestPlugin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "FrmTestPlugin";
}
#endregion
}
}

View File

@@ -0,0 +1,17 @@
using System.Windows.Forms;
using VAR.Toolbox.UI;
namespace VAR.Toolbox.TestPlugin
{
public partial class FrmTestPlugin : Form, IToolForm
{
public FrmTestPlugin()
{
InitializeComponent();
}
public string ToolName { get { return "Test"; } }
public bool HasIcon { get { return false; } }
}
}

View File

@@ -0,0 +1,13 @@
## Preparation
* Build as class library.
* Add reference to ```VAR.Toolbox``` for interface declarations and utilities.
* Use the interfaces to extend functionality:
* ```IToolForm```: Tool window.
* ```IToolPanel```: Tool panels in the main window. Try to fit all on 200px width.
* ```ITextCoder```: Text codification clases.
* ```IProxyCmdExecutor```: Proxy command executors, mainly for remote executions.
## Usage
Put the generated assembly near ```VAR.Toolbox.exe``` it will load as plug-ins any assembly that starts with ```VAR.Toolbox```

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VAR.Toolbox.TestPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VAR.Toolbox.TestPlugin")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("74fe172a-d63c-460e-b15f-debf4150bab1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{74FE172A-D63C-460E-B15F-DEBF4150BAB1}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VAR.Toolbox.TestPlugin</RootNamespace>
<AssemblyName>VAR.Toolbox.TestPlugin</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FrmTestPlugin.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmTestPlugin.Designer.cs">
<DependentUpon>FrmTestPlugin.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VAR.Toolbox\VAR.Toolbox.csproj">
<Project>{e8dab98d-4fd0-4d40-b29a-62b4c2fca4d7}</Project>
<Name>VAR.Toolbox</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Notes.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>