using Shared.SimpleControl.Phone;
|
using System;
|
namespace Shared.SimpleControl.Pad
|
{
|
public class WarningList
|
{
|
public static void ShowWarningListPage ()
|
{
|
Dialog dialog = new Dialog ();
|
FrameLayout MianView = new FrameLayout ();
|
dialog.AddChidren (MianView);
|
MianView.MouseUpEventHandler += (sender, e) => {
|
dialog.Close ();
|
};
|
|
FrameLayout bodyView = new FrameLayout () {
|
Gravity = Gravity.Center,
|
Width = Application.GetRealWidth(700),
|
Height = Application.GetRealHeight(800),
|
BackgroundColor = 0xFF2f2f2f,
|
BorderColor =0x00000000,
|
Radius = 5,
|
BorderWidth = 1,
|
};
|
MianView.AddChidren (bodyView);
|
|
Button topButton = new Button () {
|
Height = Application.GetRealHeight (120),
|
BackgroundColor = SkinStyle.Current.MainColor,
|
TextAlignment = TextAlignment.Center,
|
TextID = R.MyInternationalizationString.MessageAlert,
|
TextSize = 20,
|
};
|
bodyView.AddChidren (topButton);
|
|
VerticalScrolViewLayout msgView = new VerticalScrolViewLayout () {
|
Y = topButton.Bottom,
|
Height = Application.GetRealHeight (800 - 120),
|
};
|
bodyView.AddChidren (msgView);
|
|
foreach (var msg in RemoteInfo.Current.RemoteInfoList) {
|
RowLayout rol = new RowLayout () {
|
Height = Application.GetRealHeight (130),
|
};
|
msgView.AddChidren (rol);
|
Button btnIcon = new Button () {
|
X = Application.GetRealWidth (15),
|
Y = Application.GetRealHeight (10),
|
Width = Application.GetRealWidth (105),
|
Height = Application.GetRealHeight (105),
|
UnSelectedImagePath = "RemoteMsg/RemoteMsg.png",
|
SelectedImagePath = "RemoteMsg/RemoteWarining.png",
|
IsSelected = msg.MsgType == "警报" ? true : false,
|
Enable = false,
|
};
|
rol.AddChidren (btnIcon);
|
|
Button btnMsg = new Button () {
|
X = btnIcon.Right,
|
Width = Application.GetRealWidth(350),
|
Text = msg.Msg,
|
TextAlignment = TextAlignment.CenterLeft
|
};
|
rol.AddChidren (btnMsg);
|
|
EditText btnDate = new EditText () {
|
Y = Application.GetRealHeight (100),
|
Width = Application.GetRealWidth (620),
|
TextAlignment = TextAlignment.CenterRight,
|
Height = Application.GetRealHeight (40),
|
Text = msg.MsgTime.ToLocalTime ().ToString ("G"),
|
};
|
rol.AddChidren (btnDate);
|
|
Button btnDel = new Button () {
|
TextID = R.MyInternationalizationString.Del,
|
BackgroundColor = SkinStyle.Current.DelColor,
|
Tag = msg
|
};
|
rol.AddRightView (btnDel);
|
btnDel.MouseUpEventHandler += (sender, e) => {
|
RemoteInfo.Current.Del ((RemoteInfoMsg)(((Button)sender).Tag));
|
dialog.Close ();
|
ShowWarningListPage ();
|
};
|
}
|
|
FrameLayout bottomView = new FrameLayout () {
|
Y = Application.GetRealHeight (800 - 110),
|
Height = Application.GetRealHeight (110),
|
BackgroundColor = SkinStyle.Current.MainColor
|
};
|
bodyView.AddChidren (bottomView);
|
|
Button btnClearAll = new Button () {
|
TextID = R.MyInternationalizationString.ClearInformation,
|
TextSize = 14,
|
};
|
bottomView.AddChidren (btnClearAll);
|
btnClearAll.MouseUpEventHandler += (sender, e) => {
|
Alert alert = new Alert (Language.StringByID (R.MyInternationalizationString.Tip),
|
Language.StringByID (R.MyInternationalizationString.ClearInformationTip),
|
Language.StringByID (R.MyInternationalizationString.Cancel),
|
Language.StringByID (R.MyInternationalizationString.Confrim));
|
alert.Show ();
|
alert.ResultEventHandler += (sender1, e1) => {
|
if (e1) {
|
RemoteInfo.Current.CleanAll ();
|
dialog.Close ();
|
ShowWarningListPage ();
|
}
|
};
|
};
|
|
dialog.Show ();
|
}
|
}
|
}
|