BruceLee
2019-09-24 a9f88790c31c8b61d9b90241c4df258a980f1c00
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter.Member
{
    /// <summary>
    /// 添加成员成功的画面
    /// </summary>
    public class AddMemberSuccessForm : DialogCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 界面关闭事件
        /// </summary>
        public Action FormCloseEvent = null;
        /// <summary>
        /// 成员账号信息
        /// </summary>
        private AccountInfoResult memberAccountResult = null;
        /// <summary>
        /// 成员信息
        /// </summary>
        private MemberInfoRes memberResult = null;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_accountInfoResult">成员账号信息</param>
        /// <param name="i_memberResult">成员信息</param>
        public void ShowForm(AccountInfoResult i_accountInfoResult, MemberInfoRes i_memberResult)
        {
            this.memberAccountResult = i_accountInfoResult;
            this.memberResult = i_memberResult;
 
            //初始化中部控件
            this.InitMiddleFrame();
        }
 
 
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame()
        {
            //背景框
            var frame = new FrameLayout();
            frame.Width = Application.GetRealWidth(838);
            frame.Height = Application.GetRealHeight(1097);
            frame.BackgroundColor = UserCenterColor.Current.White;
            frame.Gravity = Gravity.Center;
            frame.Radius = (uint)Application.GetMinRealAverage(6);
            bodyFrameLayout.AddChidren(frame);
 
            //用户图标
            var btnUserIcon = new PicViewControl(207, 207);
            btnUserIcon.Y = Application.GetRealHeight(104);
            btnUserIcon.Gravity = Gravity.CenterHorizontal;
            btnUserIcon.UnSelectedImagePath = "Center/Admin.png";
            frame.AddChidren(btnUserIcon);
 
            //昵称
            var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false);
            btnName.TextAlignment = TextAlignment.Center;
            btnName.Y = Application.GetRealHeight(334);
            btnName.TextColor = UserCenterColor.Current.TextColor2;
            btnName.TextSize = 16;
            btnName.Text = memberResult.UserName;
            if (string.IsNullOrEmpty(memberResult.UserName) == true)
            {
                btnName.Text = memberResult.Account;
            }
            frame.AddChidren(btnName);
 
            //权限
            var btnAuthority = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
            btnAuthority.TextAlignment = TextAlignment.Center;
            btnAuthority.Y = Application.GetRealHeight(400);
            btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor;
            btnAuthority.TextID = R.MyInternationalizationString.uMember;
            btnAuthority.TextSize = 12;
            frame.AddChidren(btnAuthority);
 
            //家族成员添加成功
            var btnSuccess = new NormalViewControl(frame.Width, Application.GetRealHeight(82), false);
            btnSuccess.Y = Application.GetRealHeight(547);
            btnSuccess.TextAlignment = TextAlignment.Center;
            btnSuccess.TextID = R.MyInternationalizationString.uAddMemberSuccess;
            btnSuccess.TextSize = 20;
            frame.AddChidren(btnSuccess);
 
            //房间里面有设备才会显示共享设备菜单
            if (this.CheckIsCanShard() == true)
            {
                //配置共享内容
                var btnmsg = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
                btnmsg.Y = Application.GetRealHeight(783);
                btnmsg.TextSize = 12;
                btnmsg.TextAlignment = TextAlignment.Center;
                btnmsg.TextColor = UserCenterColor.Current.TextOrangeColor;
                btnmsg.Text = Language.StringByID(R.MyInternationalizationString.uConfigureSharedContent);
                btnmsg.ButtonClickEvent += (sender, e) =>
                {
                    //先清空共享文件夹
                    HdlShardLogic.Current.ClearShardDirectory();
 
                    var memberInfo = new MemberShardInfoData();
                    var form = new SharedContent.ConfigureNewSharedListRoomForm();
                    this.AddFromAndRemoveNowForm(form, memberResult, memberInfo);
                };
                frame.AddChidren(btnmsg);
 
                //底线
                int lineWidth = btnmsg.GetRealWidthByText(12);
                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
                btnLine.Gravity = Gravity.CenterHorizontal;
                btnLine.Y = btnmsg.Bottom - Application.GetRealHeight(10);
                frame.AddChidren(btnLine);
 
            }
 
            //完成
            var btnFinish = new BottomClickButton(688);
            btnFinish.Y = Application.GetRealHeight(867);
            btnFinish.TextID = R.MyInternationalizationString.uFinish;
            frame.AddChidren(btnFinish);
            btnFinish.ButtonClickEvent += (sender, e) =>
            {
                this.CloseForm();
            };
        }
 
        #endregion
 
        #region ■ 一般方法___________________________
 
        /// <summary>
        /// 检测能否分享
        /// </summary>
        /// <returns></returns>
        private bool CheckIsCanShard()
        {
            //foreach (var room in Shared.Common.Room.Lists)
            //{
            //    if (room.DeviceUIList.Count > 0)
            //    {
            //        return true;
            //    }
            //}
            return false;
        }
 
        #endregion
    }
}