wxr
2021-07-01 471c4f70d808b6993cab066dfbe807954418ea92
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Stan;
using System.Collections.Generic;
using HDL_ON.Entity;
 
namespace HDL_ON.UI
{
    /// <summary>
    /// 管理员权限迁移结果界面
    /// </summary>
    public class AdminMigrationResultPage : EditorCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 结束事件
        /// </summary>
        public Action FinishEvent = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_memberInfo">成员信息</param>
        /// <param name="i_success">是否成功</param>
        public void ShowForm(bool i_success)
        {
            this.ScrollLeftEnabled = false;
            //管理员权限转移
            base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer));
 
            //初始化中部信息
            this.InitMiddleFrame(i_success);
 
            //移除返回键
            base.RemoveBackButton();
        }
 
        /// <summary>
        /// 初始化中部信息
        /// </summary>
        /// <param name="i_success">是否成功</param>
        private void InitMiddleFrame(bool i_success)
        {
            //清空bodyFrame
            this.ClearBodyFrame();
 
            //图片
            var btnPictrue = new PicViewControl(180, 180);
            btnPictrue.Y = Application.GetRealHeight(32);
            btnPictrue.Gravity = Gravity.CenterHorizontal;
            btnPictrue.UnSelectedImagePath = i_success == true ? "Public/TipIcon_Successfully.png" : "Public/TipIcon_Failed.png";
            bodyFrameLayout.AddChidren(btnPictrue);
 
            List<NormalViewControl> listContr = null;
            if (i_success == true)
            {
                //迁移成功
                string strMsg = Language.StringByID(StringId.TransferreSuccess1);
                listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.MainColor, Application.GetRealHeight(24),
                    btnPictrue.Bottom + Application.GetRealHeight(16));
 
                //迁移成功,您的权限将变为普通成员
                strMsg = Language.StringByID(StringId.TransferreSuccessMsg1);
                this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.TextualColor, Application.GetRealHeight(18),
                    listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8));
            }
            else
            {
                //迁移失败
                string strMsg = Language.StringByID(StringId.TransferreFail1);
                listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.AuxiliaryColor2, Application.GetRealHeight(24),
                    btnPictrue.Bottom + Application.GetRealHeight(16));
                //请重新尝试
                var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(18), false);
                btnMsg2.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8);
                btnMsg2.TextAlignment = TextAlignment.Center;
                btnMsg2.Gravity = Gravity.CenterHorizontal;
                btnMsg2.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
                btnMsg2.TextID = StringId.PleaseTryAgain;
                bodyFrameLayout.AddChidren(btnMsg2);
            }
 
            //完成
            var btnConfirm = new BottomClickButton(220);
            btnConfirm.Y = Application.GetRealHeight(337);
            btnConfirm.TextID = i_success == true ? StringId.Complete : StringId.Retry;
            bodyFrameLayout.AddChidren(btnConfirm);
            btnConfirm.ButtonClickEvent += (sender, e) =>
            {
                this.CloseForm();
                //回调函数
                this.FinishEvent?.Invoke();
                this.FinishEvent = null;
            };
        }
 
        #endregion
    }
}