mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-23 01:59:32 +08:00
save SystemSleep
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user