6 changed files with 67 additions and 85 deletions
@ -1,25 +0,0 @@ |
|||||
<Project Sdk="Microsoft.NET.Sdk"> |
|
||||
<PropertyGroup> |
|
||||
<OutputType>Exe</OutputType> |
|
||||
<TargetFrameworks>net461</TargetFrameworks> |
|
||||
<AssemblyName>Avalonia.Designer.HostApp</AssemblyName> |
|
||||
</PropertyGroup> |
|
||||
<ItemGroup> |
|
||||
<ProjectReference Include="..\..\Avalonia.DesignerSupport\Avalonia.DesignerSupport.csproj" /> |
|
||||
<ProjectReference Include="..\..\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj" /> |
|
||||
<ProjectReference Include="..\..\Markup\Avalonia.Markup\Avalonia.Markup.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Animation\Avalonia.Animation.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Base\Avalonia.Base.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Input\Avalonia.Input.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Interactivity\Avalonia.Interactivity.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Layout\Avalonia.Layout.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Visuals\Avalonia.Visuals.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Styling\Avalonia.Styling.csproj" /> |
|
||||
<ProjectReference Include="..\..\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj" /> |
|
||||
<ProjectReference Include="..\..\..\samples\ControlCatalog.Desktop\ControlCatalog.Desktop.csproj" /> |
|
||||
</ItemGroup> |
|
||||
<Import Condition="'$(TargetFramework)'=='net461'" Project="..\..\..\build\NetFX.props" /> |
|
||||
</Project> |
|
||||
@ -1,42 +0,0 @@ |
|||||
using System; |
|
||||
using System.IO; |
|
||||
using System.Reflection; |
|
||||
|
|
||||
namespace Avalonia.Designer.HostApp.NetFX |
|
||||
{ |
|
||||
class Program |
|
||||
{ |
|
||||
private static string s_appDir; |
|
||||
public static void Main(string[] args) |
|
||||
{ |
|
||||
s_appDir = Directory.GetCurrentDirectory(); |
|
||||
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; |
|
||||
foreach (var dll in Directory.GetFiles(s_appDir, "*.dll")) |
|
||||
{ |
|
||||
try |
|
||||
{ |
|
||||
Console.WriteLine("Loading " + dll); |
|
||||
Assembly.LoadFile(dll); |
|
||||
} |
|
||||
catch |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
Exec(args); |
|
||||
} |
|
||||
|
|
||||
static void Exec(string[] args) |
|
||||
{ |
|
||||
Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(args); |
|
||||
} |
|
||||
|
|
||||
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) |
|
||||
{ |
|
||||
string assemblyPath = Path.Combine(s_appDir, new AssemblyName(args.Name).Name + ".dll"); |
|
||||
if (File.Exists(assemblyPath) == false) return null; |
|
||||
Assembly assembly = Assembly.LoadFrom(assemblyPath); |
|
||||
return assembly; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,8 +0,0 @@ |
|||||
{ |
|
||||
"profiles": { |
|
||||
"Avalonia.Designer.HostApp.NetFX": { |
|
||||
"commandName": "Project", |
|
||||
"commandLineArgs": "--transport tcp-bson://127.0.0.1:25000/ bin/Debug/net461/ControlCatalog.Desktop.exe" |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,10 +1,47 @@ |
|||||
|
using System; |
||||
|
using System.IO; |
||||
|
using System.Reflection; |
||||
|
|
||||
namespace Avalonia.Designer.HostApp |
namespace Avalonia.Designer.HostApp.NetFX |
||||
{ |
{ |
||||
class Program |
class Program |
||||
{ |
{ |
||||
public static void Main(string[] args) |
#if NET461
|
||||
=> Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(args); |
private static string s_appDir; |
||||
|
|
||||
|
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) |
||||
|
{ |
||||
|
string assemblyPath = Path.Combine(s_appDir, new AssemblyName(args.Name).Name + ".dll"); |
||||
|
if (File.Exists(assemblyPath) == false) return null; |
||||
|
Assembly assembly = Assembly.LoadFrom(assemblyPath); |
||||
|
return assembly; |
||||
|
} |
||||
|
public static void Main(string[] args) |
||||
|
{ |
||||
|
s_appDir = Directory.GetCurrentDirectory(); |
||||
|
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; |
||||
|
foreach (var dll in Directory.GetFiles(s_appDir, "*.dll")) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
Console.WriteLine("Loading " + dll); |
||||
|
Assembly.LoadFile(dll); |
||||
|
} |
||||
|
catch |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
Exec(args); |
||||
|
} |
||||
|
|
||||
|
static void Exec(string[] args) |
||||
|
#elif NETCOREAPP2_0
|
||||
|
public static void Main(string[] args) |
||||
|
#endif
|
||||
|
{ |
||||
|
Avalonia.DesignerSupport.Remote.RemoteDesignerEntryPoint.Main(args); |
||||
|
} |
||||
|
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue