Skip to content

Commit

Permalink
cl: misc clean 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtuonghy committed Mar 22, 2024
1 parent 2d3091e commit abaac7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 35 deletions.
33 changes: 0 additions & 33 deletions App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ namespace AutoRefreshRate
/// </summary>
public partial class App : Application
{



void App_Startup(object sender, StartupEventArgs e)
{
// Process command line args
var isAutoStart = false;
//MessageBox.Show("hi");
for (int i = 0; i != e.Args.Length; ++i)
{

Expand All @@ -26,41 +21,13 @@ void App_Startup(object sender, StartupEventArgs e)
isAutoStart = true;
}
}
// Create main application window, starting minimized if specified
MainWindow mainWindow = new MainWindow();

// MessageBox.Show("check auto start: " + isAutoStart.ToString());
if (isAutoStart)
{
mainWindow.WindowState = WindowState.Minimized;
}
mainWindow.OnAutoStart();
}

// Application is running
// Process command line args
// bool startMinimized = false;
// for (int i = 0; i != e.Args.Length; ++i)
// {
// if (e.Args[i] == "/StartMinimized")
// {
// startMinimized = true;
// }
// }

// // Create main application window, starting minimized if specified
// MainWindow mainWindow = new MainWindow();
// if (startMinimized)
// {
// mainWindow.WindowState = WindowState.Minimized;
// }

//mainWindow.Show();
////base.OnStartup(e);

// }


}

}
14 changes: 12 additions & 2 deletions Views/SettingsView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AutoRefreshRate.ViewModel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -25,9 +26,18 @@ public partial class SettingsView : UserControl
public SettingsView()
{
InitializeComponent();

}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
// for .NET Core you need to add UseShellExecute = true
// see https://learn.microsoft.com/dotnet/api/system.diagnostics.processstartinfo.useshellexecute#property-value
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri)
{
UseShellExecute = true,
});
e.Handled = true;
}



}
}

0 comments on commit abaac7b

Please sign in to comment.