wxr
2020-08-13 6a9ad7ec93218913a2ce3b898bb036f18f8f0da4
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
using System;
using HDL_ON.Entity;
using Shared;
 
namespace HDL_ON.UI
{
    public partial class RoomsManagementPage
    {
        /// <summary>
        /// 进入编辑房间之后的回调
        /// </summary>
        Action editBackAction;
 
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
        {
            
        }
 
        /// <summary>
        /// 跳转到增加房间的界面
        /// </summary>
        void LoadEvent_SkipAddRoomPage()
        {
            skipAddRoomAction = (type, floor) =>
            {
                Room newRoom = new Room() {
                    sid = Guid.NewGuid().ToString(),
                };
                editBackAction = () => {            
                    LoadRoomRow(newRoom);
                };
 
                var skipPage = new RoomEditPage(newRoom, StringId.AddRoom,editBackAction);
                MainPage.BasePageView.AddChidren(skipPage);
                skipPage.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
 
        /// <summary>
        /// 跳转到编辑房间的界面
        /// </summary>
        void LoadEvent_SkipEditRoomPage(Room r,Button btnRoomName,Button btnBg)
        {
            editBackAction = () =>
            {
                if (string.IsNullOrEmpty(r.sid))
                {
                    for (int i = 0; i < roomsListView.ChildrenCount; )
                    {
                        if (roomsListView.GetChildren(i).Tag.ToString() == r.name + "line" || roomsListView.GetChildren(i).Tag.ToString() == r.name + "row")
                        {
                            roomsListView.GetChildren(i).RemoveFromParent();
                        }
                        else
                        {
                            i++;
                        }
                    }
                }
                else
                {
                    btnRoomName.Text = r.floor + " " + r.name;
                    btnBg.UnSelectedImagePath = r.backgroundImage;
                }
            };
            var skipPage = new RoomEditPage(r, StringId.EditRoomInfo,editBackAction);
            MainPage.BasePageView.AddChidren(skipPage);
            skipPage.LoadPage();
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        }
    }
}