mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Added functionality for General Settings Page (#1664)
* archive * formmated code * reverted changes to test class file. * reverted changes to test file: reverted name * added class models and updated link * removed test console project
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using Microsoft.PowerToys.Settings.UI.Views;
|
||||
using Microsoft.Toolkit.Wpf.UI.XamlHost;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
{
|
||||
@@ -23,6 +23,35 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
|
||||
ShellPage shellPage = windowsXamlHost.GetUwpInternalObject() as ShellPage;
|
||||
|
||||
if (shellPage != null)
|
||||
{
|
||||
shellPage.SetRestartElevatedCallback(delegate(string msg)
|
||||
{
|
||||
MessageBox.Show(
|
||||
msg,
|
||||
"Restart Elevated",
|
||||
MessageBoxButton.OK);
|
||||
|
||||
Program.ipcmanager.SendMessage(msg);
|
||||
|
||||
int milliseconds = 2000;
|
||||
Thread.Sleep(milliseconds);
|
||||
|
||||
System.Windows.Application.Current.Shutdown();
|
||||
});
|
||||
|
||||
shellPage.SetRunOnStartUpCallback(delegate (string msg)
|
||||
{
|
||||
MessageBox.Show(
|
||||
msg,
|
||||
"Run On Start Up",
|
||||
MessageBoxButton.OK);
|
||||
|
||||
Program.ipcmanager.SendMessage(msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (shellPage != null)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user