using System;
|
using System.Collections.Generic;
|
using Shared.Common;
|
using Shared.Phone.UserCenter.Device;
|
using ZigBee.Device;
|
namespace Shared.Phone.UserCenter.DoorLock
|
{
|
public class MemberFrozenPage : DoorLockCommonLayout, ZigBee.Common.IStatus
|
{
|
/// <summary>
|
/// 构造函数
|
/// </summary>
|
/// <param name="doorLock"></param>
|
public MemberFrozenPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj)
|
{
|
this.doorLock = doorLock;
|
this.accountObj = accountObj;
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
|
}
|
|
#region ◆ 变量申明__________________________
|
ZigBee.Device.DoorLock doorLock;
|
Shared.Phone.UserCenter.MemberInfoRes accountObj;
|
#endregion
|
|
/// <summary>
|
/// UI显示
|
/// </summary>
|
public void Show()
|
{
|
string accountTitle = "";
|
if (accountObj.UserName != null)
|
{
|
accountTitle = accountObj.UserName;
|
}
|
else
|
{
|
accountTitle = accountObj.Account;
|
}
|
this.TopFrameLayout(this, accountTitle);
|
|
EventHandler<MouseEventArgs> eHandlerBack = (sender, e) =>
|
{
|
RemoveFromParent();
|
};
|
this.btnBack.MouseUpEventHandler += eHandlerBack;
|
this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
|
this.MidFrameLayout(this);
|
|
MidFrameLayoutContent();
|
}
|
|
public void MidFrameLayoutContent()
|
{
|
var bodyView = new VerticalScrolViewLayout()
|
{
|
};
|
this.midFrameLayout.AddChidren(bodyView);
|
|
for (int i = 0; i < 3; i++)
|
{
|
var RowView = new FrameLayout()
|
{
|
Height = Application.GetRealHeight(127 + 20),
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout,
|
};
|
bodyView.AddChidren(RowView);
|
|
var btnText = new Button()
|
{
|
X = Application.GetRealWidth(58),
|
Width = Application.GetRealWidth(300),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextColor = Shared.Common.ZigbeeColor.Current.XMTopTitleText,
|
Gravity = Gravity.CenterVertical,
|
TextSize = 14,
|
};
|
RowView.AddChidren(btnText);
|
|
var btnRightFrameLayout = new FrameLayout()
|
{
|
Width = Application.GetRealWidth(204),
|
X = Application.GetRealWidth(919 - 58),
|
Y = Application.GetRealHeight(25),
|
};
|
RowView.AddChidren(btnRightFrameLayout);
|
|
var btnRight = new Button()
|
{
|
Height = Application.GetRealHeight(60),
|
Width = Application.GetRealWidth(60),
|
X = Application.GetRealWidth(72),
|
Y = Application.GetRealHeight(32),
|
UnSelectedImagePath = "DoorLock/RightIcon.png",
|
};
|
btnRightFrameLayout.AddChidren(btnRight);
|
|
var line2 = new Button()
|
{
|
Y = RowView.Height - 1,
|
X = Application.GetRealWidth(58),
|
Width = Application.GetRealWidth(962),
|
Height = 1,
|
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine,
|
};
|
RowView.AddChidren(line2);
|
|
if (i == 0)
|
{
|
btnText.Text = Language.StringByID(R.MyInternationalizationString.LockMethod);
|
}
|
else if (i == 1)
|
{
|
btnText.Text = Language.StringByID(R.MyInternationalizationString.FrozenUser);
|
btnRight.X = Application.GetRealWidth(50);
|
btnRight.Y = Application.GetRealHeight(32);
|
btnRight.Height = Application.GetRealHeight(63);
|
btnRight.Width = Application.GetRealWidth(104);
|
btnRight.UnSelectedImagePath = "DoorLock/Switch.png";
|
btnRight.SelectedImagePath = "DoorLock/SwitchOn.png";
|
}
|
else if (i == 2)
|
{
|
btnText.Text = Language.StringByID(R.MyInternationalizationString.TempUnlockPermission);
|
btnRight.X = Application.GetRealWidth(50);
|
btnRight.Y = Application.GetRealHeight(32);
|
btnRight.Height = Application.GetRealHeight(63);
|
btnRight.Width = Application.GetRealWidth(104);
|
btnRight.UnSelectedImagePath = "DoorLock/Switch.png";
|
btnRight.SelectedImagePath = "DoorLock/SwitchOn.png";
|
line2.Visible = false;
|
}
|
|
int currentIndex = i;
|
EventHandler<MouseEventArgs> eHandler = (sender, e) =>
|
{
|
if (currentIndex == 0)
|
{
|
var unLockMethod = new Shared.Phone.UserCenter.DoorLock.UnLockMethod(doorLock, accountObj);
|
Shared.Phone.UserView.HomePage.Instance.AddChidren(unLockMethod);
|
Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
|
unLockMethod.Show();
|
}
|
else if (currentIndex == 1)
|
{
|
}
|
else if (currentIndex == 2)
|
{
|
|
}
|
};
|
btnRightFrameLayout.MouseUpEventHandler += eHandler;
|
btnRight.MouseUpEventHandler += eHandler;
|
RowView.MouseUpEventHandler += eHandler;
|
btnText.MouseUpEventHandler += eHandler;
|
}
|
|
}
|
|
#region ◆ 接口实现__________________________
|
/// <summary>
|
/// 处理变化事件 --将弃用 改用DeviceInfoChange()
|
/// </summary>
|
/// <returns>The changed.</returns>
|
/// <param name="common">Common.</param>
|
public void Changed(CommonDevice common)
|
{
|
|
}
|
/// <summary>
|
/// 处理变化事件
|
/// </summary>
|
/// <param name="common"></param>
|
/// <param name="typeTag"></param>
|
public void DeviceInfoChange(CommonDevice common, string typeTag)
|
{
|
}
|
/// <summary>
|
/// Changeds the IL ogic status.
|
/// </summary>
|
/// <param name="logic">Logic.</param>
|
public void ChangedILogicStatus(ZigBee.Device.Logic logic)
|
{
|
}
|
/// <summary>
|
/// Changeds the IS cene status.
|
/// </summary>
|
/// <param name="scene">Scene.</param>
|
public void ChangedISceneStatus(Scene scene)
|
{
|
}
|
#endregion
|
}
|
}
|