LunarPresentation/App.xaml.cs

(完整代码) 1KB

using System.Windows;

namespace SHomeWorkshop.LunarPresentation
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        void App_Startup(object sender, StartupEventArgs e)
        {
            // 取命令行参数。
            for (int i = 0; i != e.Args.Length; ++i)
            {
                Globals.commandLineList.Add(e.Args[i]);
            }

            Application.Current.SessionEnding += new SessionEndingCancelEventHandler(Current_SessionEnding);
        }

        /// <summary>
        /// 此事件用以在“文档被修改且未保存的情况下,直接关闭Windows时让用户有机会保存文件”。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void Current_SessionEnding(object sender, SessionEndingCancelEventArgs e)
        {
            if (this.MainWindow != null)
            {
                MainWindow win = this.MainWindow as MainWindow;
                if (win != null)
                {
                    if (win.CloseDocuments() == false) e.Cancel = true;
                    else { e.Cancel = false; }
                }
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。