wxr
2021-07-01 43b0d5870d528f23ecd6aeceb6cfd4325188b46f
HDL_ON/UI/UI0-Public/TopViewDivBLL.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HDL_ON.Entity;
namespace HDL_ON.UI
@@ -13,32 +14,21 @@
        void LoadEvent_BackEvent()
        {
            btnBack.MouseUpEventHandler = (sender, e) => {
                if (backAction != null)
                backAction?.Invoke();
                if (needClose)
                {
                    backAction();
                }
                if (baseView != null)
                {
                    baseView.RemoveFromParent();
                }
                if (baseDialog != null)
                {
                    baseDialog.Close();
                    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>
        /// 顶部添加按钮点击事件
@@ -46,28 +36,11 @@
        /// <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;
            }
            //switch (type)
            //{
            //}
        }
    }