Refactor InteropFactory

This commit is contained in:
Michael Bucari-Tovo 2023-02-18 10:43:13 -07:00
parent 14b63c0883
commit a00849fb6f
12 changed files with 41 additions and 159 deletions

View file

@ -1,6 +1,5 @@
using LibationFileManager;
using System.Diagnostics;
using System.Reflection;
namespace LinuxConfigApp
{
@ -39,8 +38,6 @@ namespace LinuxConfigApp
//prompt across multiple distributions and desktop environments.
const string runasroot = "runasroot.sh";
var asmDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string command = $"{exe ?? ""} {args ?? ""}".Trim();
foreach (var console in consoleCommands)
@ -55,7 +52,7 @@ namespace LinuxConfigApp
$"Running '{exe}' as root", // console title
console[2],
"/bin/sh",
Path.Combine(asmDir, runasroot), //script file
Path.Combine(Configuration.ProcessDirectory, runasroot), //script file
"Installing libation.deb", //command title
command, // command to execute vis /bin/sh
$"Please run '{command}' manually" // error message to display in the terminal

View file

@ -1,11 +1,7 @@
using AppScaffolding;
namespace LinuxConfigApp
namespace LinuxConfigApp
{
class Program : OSConfigBase
class Program
{
public override Type InteropFunctionsType => typeof(LinuxInterop);
static void Main() => new Program().Run();
static void Main() { }
}
}

View file

@ -1,11 +1,7 @@
using AppScaffolding;
namespace MacOSConfigApp
namespace MacOSConfigApp
{
class Program : OSConfigBase
class Program
{
public override Type InteropFunctionsType => typeof(MacOSInterop);
static void Main() => new Program().Run();
static void Main() { }
}
}

View file

@ -1,18 +1,7 @@
using AppScaffolding;
namespace WindowsConfigApp
{
class Program : OSConfigBase
class Program
{
public override Type InteropFunctionsType => typeof(WinInterop);
public override Type[] ReferencedTypes => new Type[]
{
typeof(Bitmap),
typeof(Dinah.Core.WindowsDesktop.GitClient),
typeof(Accessibility.IAccIdentity),
typeof(Microsoft.Win32.SystemEvents)
};
static void Main() => new Program().Run();
static void Main() { }
}
}