Merge branch 'master' of http://www.scserverddns.top:13000/sc/formula_manage
This commit is contained in:
commit
7ff192068a
3 files changed
+61
-1
No files matched your search
+49
@@ -13,5 +13,54 @@ namespace formula_manage
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
public App()
|
||||
{
|
||||
this.Startup += new StartupEventHandler(App_Startup);
|
||||
this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
|
||||
}
|
||||
|
||||
System.Threading.Mutex mutex;
|
||||
void App_Startup(object sender, StartupEventArgs e) //程序只允许启动一次
|
||||
{
|
||||
bool ret;
|
||||
mutex = new System.Threading.Mutex(true, "ElectronicNeedleTherapySystem", out ret);
|
||||
if (!ret)
|
||||
{
|
||||
MessageBox.Show("SUNLIGHT:单据管理已启动");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e) //跟踪报错信息
|
||||
{
|
||||
base.OnStartup(e);
|
||||
//UI线程的异常捕捉
|
||||
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
|
||||
}
|
||||
|
||||
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
|
||||
e.Handled = true;
|
||||
if (e.Exception.InnerException == null)
|
||||
{
|
||||
MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!" + Environment.NewLine
|
||||
// + "(2)错误源:" + e.Exception.Source + Environment.NewLine
|
||||
+ "详细信息:" + e.Exception.Message + Environment.NewLine
|
||||
// + "(4)报错区域:" + e.Exception.StackTrace
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("发生了一个无法处理的错误!请联系SUNLIGHT处理!" + Environment.NewLine
|
||||
// + "(2)错误源:" + e.Exception.InnerException.Source + Environment.NewLine
|
||||
+ "错误信息:" + e.Exception.Message + Environment.NewLine
|
||||
// + "(4)详细信息:" + e.Exception.InnerException.Message + Environment.NewLine
|
||||
// + "(5)报错区域:" + e.Exception.InnerException.StackTrace
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -24,6 +24,7 @@
|
||||
<ComboBoxItem Content="Windows 身份认证"></ComboBoxItem>
|
||||
<ComboBoxItem Content="SQL SERVER 身份认证"></ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Button Content="保存" HorizontalAlignment="Center" Height="34" Margin="0,362,0,0" VerticalAlignment="Top" Width="81" BorderBrush="White"/>
|
||||
<Button Content="保存" HorizontalAlignment="Right" Height="24" Margin="0,362,20,0" VerticalAlignment="Top" Width="80" BorderBrush="White" Click="Button_Click"/>
|
||||
<Button Content="测试" HorizontalAlignment="Left" Height="24" Margin="20,362,0,0" VerticalAlignment="Top" Width="80" BorderBrush="White" Click="Button_Click_1"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -30,5 +30,15 @@ namespace formula_manage.Windows
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user