save SystemSleep

This commit is contained in:
Mossimo
2021-12-06 14:35:30 +08:00
parent 3b423b4f84
commit f7d8eefe1c
2 changed files with 46 additions and 0 deletions
@@ -153,5 +153,25 @@ namespace System.Application.Services.Implementation
((IPlatformService)this).RunShell(shellContent.ToString(), false);
return true;
}
public void SystemLock(int waitSecond = 30)
{
throw new NotImplementedException();
}
public async void SystemShutdown(int waitSecond = 30)
{
}
public async void SystemSleep(int waitSecond = 30)
{
}
public async void SystemHibernate(int waitSecond = 30)
{
}
}
}
@@ -248,5 +248,31 @@ namespace System.Application.Services.Implementation
((IPlatformService)this).RunShell(shellContent.ToString(), false);
return true;
}
public void SystemLock(int waitSecond = 30)
{
throw new NotImplementedException();
}
public void SystemShutdown(int waitSecond = 30)
{
throw new NotImplementedException();
}
public void SystemSleep(int waitSecond = 30)
{
using var p = new Process();
p.StartInfo.FileName = "osascript";
p.StartInfo.Arguments = " -e ' tell application \"Finder\" to sleep do shell script \"Killall \" & quoted form of \"%s\"'";
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
}
public void SystemHibernate(int waitSecond = 30)
{
throw new NotImplementedException();
}
}
}