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) => {
|
backAction?.Invoke();
|
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) =>
|
{
|
callBack("add", floorName);
|
};
|
string newFloorName = "1 F";
|
for (int i = 0; i < DB_ResidenceData.residenceData.floors.Count + 1; )
|
{
|
newFloorName = ++i + " F";
|
if (!DB_ResidenceData.residenceData.floors.Contains(newFloorName))
|
{
|
break;
|
}
|
}
|
new PublicAssmebly().LoadDialog_EditParater(StringId.AddFloors,newFloorName , callBackAction,StringId.FloorNameCannotBeEmpty,StringId.AddFloorFailed_FloorAlreadyExist,DB_ResidenceData.residenceData.floors);
|
break;
|
case "rooms":
|
callBack("", "");
|
break;
|
case "Member":
|
callBack("","");
|
break;
|
|
}
|
}
|
|
}
|
}
|