📄 app.xaml.cs
字号:
// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Chat Demo is licensed to you under the terms
// described in the CHAT_DEMO_LICENSE file included in this
// distribution.
//
// **********************************************************************
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Data;
namespace ChatDemoGUI
{
//
// The App class is a partial class that is partially defined in App.xaml.
//
public partial class App : Application
{
public App()
{
InitializeComponent();
}
protected override void OnExit(ExitEventArgs e)
{
if(_hasNetFramework)
{
_coordinator.storeWindowPrefs();
_coordinator.logout();
}
}
public Coordinator getCoordinator()
{
return _coordinator;
}
private void AppStartup(object sender, StartupEventArgs e)
{
if(!System.IO.Directory.Exists(System.Environment.GetEnvironmentVariable("systemroot")
+ "\\Microsoft.NET\\Framework\\v3.5"))
{
string errorMessage = "Chat Demo \n" +
"You need to install Microsoft .NET Framework v3.5 in order to run this application.\n" +
"Refer to the README file in your Chat Demo distribution for more information.";
string caption = "Chat Demo - Error";
MessageBoxImage icon = MessageBoxImage.Error;
MessageBoxButton button = MessageBoxButton.OK;
MessageBox.Show(errorMessage, caption, button, icon);
Shutdown(-1);
}
else
{
_hasNetFramework = true;
_coordinator = new Coordinator(e.Args);
}
}
private Coordinator _coordinator = null;
private bool _hasNetFramework = false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -