Exemplo n.º 1
0
        private async void ShowQuitDialogAsync()
        {
            MsgAction result = await HandyControl.Controls.Dialog.Show <OperateGrandDialog>()
                               .Initialize <OperateGrandDialogViewModel>((vm) => { vm.Clear(); vm.SetDialog(true); }).GetResultAsync <MsgAction>();

            if (result.o1 is null)
            {
                Growl.Error("退出失败,认证错误!");
                return;
            }

            if (result.o1 is int cint)
            {
                return;
            }

            if (result.o1 is WcsUser user)
            {
                if (user.exitwcs)
                {
                    mLog.Status(true, "调度关闭:" + user.name);
                    PubMaster.Warn.Stop();
                    PubTask.Stop();
                    PubMaster.StopMaster();
                    Environment.Exit(0);
                    return;
                }
                else
                {
                    mLog.Status(true, user.name + ":没有退出调度的权限!");
                }
                Growl.Error(user.name + ":没有退出调度的权限!");
            }
        }