Added console bootstrapper

This commit is contained in:
Michael Becker 2014-06-05 10:10:15 -04:00
parent 81dda5fe08
commit 848c62c014
9 changed files with 202 additions and 1 deletions

View File

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using UniversalEditor.UserInterface;

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Plugins" />
</assemblyBinding>
</runtime>
</configuration>

View File

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using UniversalEditor.UserInterface;
namespace UniversalEditor.ConsoleBootstrapper
{
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
string directory = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string[] libraries = System.IO.Directory.GetFiles(directory, "*.dll");
List<Engine> engines = new List<Engine>();
foreach (string library in libraries)
{
try
{
Assembly assembly = Assembly.LoadFile(library);
Type[] types = null;
try
{
types = assembly.GetTypes();
}
catch (ReflectionTypeLoadException ex)
{
types = ex.Types;
}
if (types == null)
{
continue;
}
foreach (Type type in types)
{
if (type.IsSubclassOf(typeof(Engine)))
{
Engine engine = (Engine)type.Assembly.CreateInstance(type.FullName);
engines.Add(engine);
}
}
}
catch
{
}
}
if (engines.Count < 1)
{
ConsoleColor oldcolor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ERROR: No engines are available to launch this application.");
Console.ForegroundColor = oldcolor;
Pause();
return;
}
else if (engines.Count == 1)
{
engines[0].StartApplication();
}
else
{
engines[0].StartApplication();
}
}
private static void Pause()
{
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("UniversalEditor.ConsoleBootstrapper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("City of Orlando")]
[assembly: AssemblyProduct("UniversalEditor.ConsoleBootstrapper")]
[assembly: AssemblyCopyright("Copyright © City of Orlando 2014")]
[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("78501f14-ac94-478c-913c-b325e8d5f438")]
// 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,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.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>{62CFC025-B8CF-42AA-880A-92F27377FCAF}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UniversalEditor.ConsoleBootstrapper</RootNamespace>
<AssemblyName>UniversalEditorConsole</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Output\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Output\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="metro-mainicon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libraries\UniversalEditor.Core\UniversalEditor.Core.csproj">
<Project>{2d4737e6-6d95-408a-90db-8dff38147e85}</Project>
<Name>UniversalEditor.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Libraries\UniversalEditor.UserInterface\UniversalEditor.UserInterface.csproj">
<Project>{8622ebc4-8e20-476e-b284-33d472081f5c}</Project>
<Name>UniversalEditor.UserInterface</Name>
</ProjectReference>
<ProjectReference Include="..\..\Plugins\UniversalEditor.Essential\UniversalEditor.Essential.csproj">
<Project>{30467e5c-05bc-4856-aadc-13906ef4cadd}</Project>
<Name>UniversalEditor.Essential</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -63,6 +63,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.New
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.Abomination", "Plugins\UniversalEditor.Plugins.Abomination\UniversalEditor.Plugins.Abomination.csproj", "{D4D9C9A6-04A4-46AD-8238-2493A455723F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.ConsoleBootstrapper", "Applications\UniversalEditor.ConsoleBootstrapper\UniversalEditor.ConsoleBootstrapper.csproj", "{62CFC025-B8CF-42AA-880A-92F27377FCAF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -199,6 +201,12 @@ Global
{D4D9C9A6-04A4-46AD-8238-2493A455723F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4D9C9A6-04A4-46AD-8238-2493A455723F}.Release|Any CPU.Build.0 = Release|Any CPU
{D4D9C9A6-04A4-46AD-8238-2493A455723F}.Release|x86.ActiveCfg = Release|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Debug|x86.ActiveCfg = Debug|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Release|Any CPU.Build.0 = Release|Any CPU
{62CFC025-B8CF-42AA-880A-92F27377FCAF}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -209,6 +217,7 @@ Global
{8622EBC4-8E20-476E-B284-33D472081F5C} = {15D19291-4200-4C30-A68A-0191B6F83BE1}
{BAC9FDFD-C39E-4A90-B9F8-CF75B551BE10} = {A935623A-E98E-43FF-BBE2-DAA61A587345}
{6F0AB1AF-E1A1-4D19-B19C-05BBB15C94B2} = {A935623A-E98E-43FF-BBE2-DAA61A587345}
{62CFC025-B8CF-42AA-880A-92F27377FCAF} = {A935623A-E98E-43FF-BBE2-DAA61A587345}
{30467E5C-05BC-4856-AADC-13906EF4CADD} = {71CFF024-26F7-4626-A526-B435FDF8D64E}
{7CA0A889-C1A1-4CEB-AA54-43A640B41C6C} = {71CFF024-26F7-4626-A526-B435FDF8D64E}
{BE4D0BA3-0888-42A5-9C09-FC308A4509D2} = {71CFF024-26F7-4626-A526-B435FDF8D64E}