Files
Wino-Mail/Wino.Shared.WinRT/Services/WinoIPCServerConnectionManager.cs
Burak Kaan Köse 2fbcf8e104 Launching server.
2024-07-22 11:05:04 +02:00

42 lines
1.2 KiB
C#

using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Wino.Domain.Interfaces;
namespace Wino.Shared.WinRT.Services
{
public class WinoIPCServerConnectionManager : ServerConnectionManagerBase, IWinoServerConnectionManager
{
public override Task<bool> ConnectAsync()
{
string directory = Path.Combine(Package.Current.InstalledLocation.Path, "Wino.Server", "Wino.Server.exe");
Process P = new();
P.StartInfo.UseShellExecute = true;
P.StartInfo.Verb = "runas";
P.StartInfo.FileName = directory;
// TODO: Pass server start arguments with additional options.
P.StartInfo.Arguments = "";
return Task.FromResult(P.Start());
}
//public Task<bool> DisconnectAsync()
//{
// throw new NotImplementedException();
//}
//public void DisposeConnection()
//{
// throw new NotImplementedException();
//}
//public void QueueRequest(IRequestBase request, Guid accountId)
//{
// throw new NotImplementedException();
//}
}
}