Sysnet.TouchScreen/AppCode/ApplicationController.cs

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using GalaSoft.MvvmLight.Messaging;

namespace Sysnet.TouchScreen
{
    /// <summary>
    /// Controls the application workflow.
    /// Opens windows with their view models.
    /// </summary>
    public class ApplicationController
    {
        /// <summary>
        /// A controller specific for dialog message and common dialog windows
        /// </summary>
        private DialogController _dialogController;


        public ApplicationController()
        {
            this._dialogController = new DialogController();


            Messenger.Default.Register<GenericMessageAction<MsgShowExtractPages, MsgOpenFile>>(this, MsgShowExtractPages_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowDeletePages, MsgOpenFile>>(this, MsgShowDeletePages_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowInsertPages, MsgOpenFile>>(this, MsgShowInsertPages_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowRotatePages, MsgOpenFile>>(this, MsgShowRotatePages_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowMergeDocuments, MsgOpenFile>>(this, MsgShowMergeDocuments_Handler);
            Messenger.Default.Register<MsgShowBurst>(this, MsgShowBurst_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowSecurity, MsgOpenFile>>(this, MsgShowSecurity_Handler);

            Messenger.Default.Register<GenericMessageAction<MsgShowConfirmPassword, bool>>(this, MsgShowConfirmPassword_Handler);
            Messenger.Default.Register<GenericMessageAction<MsgShowEnterPassword, string>>(this, MsgShowEnterPassword_Handler);

            Messenger.Default.Register<MsgShowNewVersion>(this, MsgShowNewVersion_Handler);
            Messenger.Default.Register<MsgShowAbout>(this, MsgShowAbout_Handler);
        }


        /// <summary>
        /// Returns the current active window
        /// </summary>
        /// <returns></returns>
        Window GetActiveWindow()
        {
            Window window = null;
            foreach (Window w in App.Current.Windows)
            {
                if (w.IsActive)
                {
                    window = w;
                    break;
                }
            }
            return window;
        }
后面还有 184 行代码,购买后查看完整代码

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

AI 解读

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

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