wxr
2020-03-13 171bf03f3664226eeff2b20ee9bd2e914b63a17d
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
using System;
using HDL_ON.Entity;
 
namespace HDL_ON.UI
{
    public partial class TopViewDiv
    {
        void LoadEventList()
        {
            LoadEvent_BackEvent();
        }
 
        void LoadEvent_BackEvent()
        {
            btnBack.MouseUpEventHandler = (sender, e) => {
                if (backAction != null)
                {
                    backAction();
                }
                if (baseView != null)
                {
                    baseView.RemoveFromParent();
                }
                if (baseDialog != null)
                {
                    baseDialog.Close();
                }
            };
        }
 
        /// <summary>
        /// 顶部按钮跳转功能配置页面
        /// </summary>
        /// <param name="function"></param>
        void LoadEvent_SkipFunctionSetting(Function function)
        {
            var infoView = new FunctionBaseInfoSetPage(function,backAction);
            MainPage.BasePageView.AddChidren(infoView);
            infoView.LoadPage();
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        }
 
        /// <summary>
        /// 顶部添加按钮点击事件
        /// </summary>
        /// <param name="type">添加按钮的功能类型</param>
        void LoadEvent_AddEvent(string type,Action <string,string> callBack)
        {
            switch (type)
            {
                case "floors":
                    Action<string> callBackAction = (floorName) =>
                    {
                        if (DB_ResidenceData.residenceData.floors.Contains(floorName))
                        {
                            return;
                        }
                        else
                        {
                            DB_ResidenceData.residenceData.floors.Add(floorName);
                            DB_ResidenceData.residenceData.SaveResidenceData();
                            callBack("add", floorName);
                        }
                    };
                    new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors, DB_ResidenceData.residenceData.floors.Count + 1 + " F", callBackAction);
                    break;
                case "rooms":
                    callBack("", "");
                    break;
            }
        }
 
    }
}