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
{
///
/// 管理员权限迁移结果界面
///
public class AdminMigrationResultPage : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 结束事件
///
public Action FinishEvent = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
/// 成员信息
/// 是否成功
public void ShowForm(bool i_success)
{
this.ScrollLeftEnabled = false;
//管理员权限转移
base.SetTitleText(Language.StringByID(StringId.AdminAuthorityTransfer));
//初始化中部信息
this.InitMiddleFrame(i_success);
//移除返回键
base.RemoveBackButton();
}
///
/// 初始化中部信息
///
/// 是否成功
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 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
}
}