Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Plugin system #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions EVEMon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.EVEMon", "tests\Tests
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Helpers", "tests\Tests.Helpers\Tests.Helpers.csproj", "{1917E258-0979-4333-8B20-5D66E8986E1C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{894945A4-8C92-451A-9FFE-0C5402EBD68E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EVEMon.PluginViewer", "plugins\EVEMon.PluginViewer\EVEMon.PluginViewer.csproj", "{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -133,6 +137,12 @@ Global
{1917E258-0979-4333-8B20-5D66E8986E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1917E258-0979-4333-8B20-5D66E8986E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1917E258-0979-4333-8B20-5D66E8986E1C}.Snapshot|Any CPU.ActiveCfg = Snapshot|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Release|Any CPU.Build.0 = Release|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Snapshot|Any CPU.ActiveCfg = Release|Any CPU
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}.Snapshot|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -152,5 +162,6 @@ Global
{87682BB1-CCE5-4CA4-BDE8-1A2ACF0B3CE0} = {9AB16E7E-E520-4444-8E8E-165129CC93B3}
{FD639BF6-3414-4FB2-8325-61744D44F028} = {B2FD94FF-A895-4519-A97F-6DEA32F15F8E}
{1917E258-0979-4333-8B20-5D66E8986E1C} = {B2FD94FF-A895-4519-A97F-6DEA32F15F8E}
{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2} = {894945A4-8C92-451A-9FFE-0C5402EBD68E}
EndGlobalSection
EndGlobal
111 changes: 111 additions & 0 deletions plugins/EVEMon.PluginViewer/EVEMon.PluginViewer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{E11D68FA-686E-45E0-9FA2-9EC9F90ECCA2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EVEMon.PluginViewer</RootNamespace>
<AssemblyName>EVEMon.PluginViewer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\src\EVEMon\bin\Debug\Plugins\</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>..\..\src\EVEMon\bin\Release\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<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="PluginViewer.cs" />
<Compile Include="PluginViewerForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PluginViewerForm.Designer.cs">
<DependentUpon>PluginViewerForm.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PluginViewerForm.resx">
<DependentUpon>PluginViewerForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EVEMon.Common\EVEMon.Common.csproj">
<Project>{c0665275-3e0b-4117-81b0-751206ed03cd}</Project>
<Name>EVEMon.Common</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
111 changes: 111 additions & 0 deletions plugins/EVEMon.PluginViewer/PluginViewer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;

using EVEMon.Common.PluginSytem;

namespace EVEMon.PluginViewer
{
/// <summary>
/// PluginViewer class used to see what plugins are loaded.
/// </summary>
class PluginViewer : IPluginMenuItem
{

#region Fields

/// <summary>
/// The MenuItem to be sent to the plugin interface.
/// </summary>
private ToolStripMenuItem _mnuPluginViewer;

/// <summary>
/// The Plugin name constant.
/// </summary>
private const string _pluginName = "Plugin Viewer";

/// <summary>
/// The plugin version constant.
/// </summary>
private const string _pluginVersion = "0.1";

#endregion Fields


#region Constructor

/// <summary>
/// Constructor for the PluginViewer class.
/// </summary>
public PluginViewer()
{
// Initialize the menuitem.
ToolStripMenuItem mnuPluginViewer = new ToolStripMenuItem();
mnuPluginViewer.Name = "mnuPluginViewer";
mnuPluginViewer.Size = new System.Drawing.Size(114, 20);
mnuPluginViewer.Text = "Plugin Viewer...";
mnuPluginViewer.Click += new System.EventHandler(mnuPluginViewer_Click);
_mnuPluginViewer = mnuPluginViewer;
}

#endregion Constructor


#region IPLuginMenuItem implementation

/// <summary>
/// Gets the MenuItemList information for the plugin system.
/// </summary>
public IEnumerable<ToolStripMenuItem> MenuItemList
{
get
{
var list = new List<ToolStripMenuItem>();
list.Add(_mnuPluginViewer);
return list;
}
}

/// <summary>
/// Gets the plugin name for the plugin system.
/// </summary>
public string PluginName
{
get
{
return _pluginName;
}

}

/// <summary>
/// Gets the plugin version for the plugin system.
/// </summary>
public string PluginVersion
{
get
{
return _pluginVersion;
}
}

#endregion IPLuginMenuItem implementation


#region Event Handler

/// <summary>
/// Event handling for when the Menu item is clicked.
/// </summary>
/// <param name="sender">the control sending.</param>
/// <param name="e">event args</param>
private void mnuPluginViewer_Click(object sender, EventArgs e)
{
PluginViewerForm viewer = new PluginViewerForm();
viewer.ShowDialog();
}

#endregion Event Handler

}
}
115 changes: 115 additions & 0 deletions plugins/EVEMon.PluginViewer/PluginViewerForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading