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.
67 lines
2.1 KiB
67 lines
2.1 KiB
using System;
|
|
using System.Windows;
|
|
using SSWMS.Common;
|
|
using Microsoft.VisualBasic.ApplicationServices;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace SSWMS.Client
|
|
{
|
|
public partial class MainApp : Application
|
|
{
|
|
public static string _Language { get; set; }
|
|
public static IList<SYS_ROLE> _lRole;
|
|
public static SYS_USER _USER = null;
|
|
|
|
protected override void OnStartup(System.Windows.StartupEventArgs e)
|
|
{
|
|
_Language = AppSettings.GetValue("Language");
|
|
ResourceDictionary rd = Application.Current.Resources.MergedDictionaries.First(p => p.Source.ToString().Contains("Language"));
|
|
rd.Source = new Uri(String.Format("@Styles/Language.{0}.xaml", MainApp._Language), UriKind.RelativeOrAbsolute);
|
|
XmlStyle.Init(AppDomain.CurrentDomain.BaseDirectory + "@Files\\FormStyles.xml");
|
|
base.OnStartup(e);
|
|
}
|
|
}
|
|
|
|
public class StartupObject : WindowsFormsApplicationBase
|
|
{
|
|
[STAThread]
|
|
public static void Main(string[] args)
|
|
{
|
|
new StartupObject().Run(args);
|
|
}
|
|
|
|
private MainApp app = null;
|
|
private StartupObject()
|
|
{
|
|
this.IsSingleInstance = true;
|
|
}
|
|
|
|
protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs)
|
|
{
|
|
app = new MainApp
|
|
{
|
|
StartupUri = new Uri("Login.xaml", UriKind.RelativeOrAbsolute)
|
|
};
|
|
app.InitializeComponent();
|
|
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);
|
|
}
|
|
}
|
|
}
|