You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
51 lines
1.3 KiB
using Microsoft.VisualBasic.ApplicationServices;
|
|
using System;
|
|
using System.Windows;
|
|
|
|
namespace SSWMS.Server
|
|
{
|
|
public partial class App : Application
|
|
{
|
|
}
|
|
|
|
public class StartupObject : WindowsFormsApplicationBase
|
|
{
|
|
[STAThread]
|
|
public static void Main(string[] args)
|
|
{
|
|
new StartupObject().Run(args);
|
|
}
|
|
|
|
private App app = null;
|
|
private StartupObject()
|
|
{
|
|
this.IsSingleInstance = true;
|
|
}
|
|
|
|
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs)
|
|
{
|
|
app = new App
|
|
{
|
|
StartupUri = new Uri("MainWindow.xaml", UriKind.RelativeOrAbsolute)
|
|
};
|
|
app.Run();
|
|
return false;
|
|
}
|
|
|
|
protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
|
|
{
|
|
try
|
|
{
|
|
app.MainWindow.Show();
|
|
app.MainWindow.WindowState = WindowState.Maximized;
|
|
app.MainWindow.Topmost = true;
|
|
app.MainWindow.Activate();
|
|
app.MainWindow.Topmost = false;
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
base.OnStartupNextInstance(eventArgs);
|
|
}
|
|
}
|
|
}
|