using System;
namespace Shared.Phone.UserCenter.GatewayAdd
{
///
/// 添加网关的选择画面
///
public class NewGateWayMenuSelectForm : EditorCommonForm
{
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
public void ShowForm()
{
//设置头部信息
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddGateway));
//初始化中部信息
this.InitMiddleFrame();
}
///
/// 初始化中部信息
///
private void InitMiddleFrame()
{
//清空bodyFrame
this.ClearBodyFrame();
var listView = new VerticalListControl(29);
listView.Height = Application.GetRealHeight(340);
listView.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(listView);
//有线网关
var row1 = new FrameRowControl(listView.rowSpace / 2);
listView.AddChidren(row1);
var btnIcon1 = row1.AddLeftIcon(81);
btnIcon1.UnSelectedImagePath = "Gateway/WiredGateway.png";
var btntext1 = row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWiredGateway), 500);
btntext1.TextSize = 15;
row1.AddRightArrow();
row1.AddBottomLine();
row1.ButtonClickEvent += (sender, e) =>
{
var form = new WiredGatewayDirectionForm();
form.AddForm();
};
//无线网关
var row2 = new FrameRowControl(listView.rowSpace / 2);
listView.AddChidren(row2);
var btnIcon2 = row2.AddLeftIcon(81);
btnIcon2.UnSelectedImagePath = "Gateway/WirelessGateway.png";
var btntext2 = row2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWirelessGateway), 500);
btntext2.TextSize = 15;
row2.AddRightArrow();
row2.ButtonClickEvent += (sender, e) =>
{
var menuContr = new BottomMenuSelectForm();
menuContr.AddForm(2);
//UDP模式(推荐)
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uUdpModeRecommend), () =>
{
var form = new WirelessUdpDirectionForm();
form.AddForm();
});
//AP模式
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uApMode), () =>
{
var form = new WirelessApDirection1Form();
form.AddForm();
});
};
}
///
/// 菜单控件
///
private class SearchWirelessMenuControl : DialogCommonForm
{
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
public void ShowForm()
{
var frameBack1 = new FrameLayoutControl();
frameBack1.UseClickStatu = false;
frameBack1.Y = Application.GetRealHeight(1420);
frameBack1.Gravity = Gravity.CenterHorizontal;
frameBack1.RadiusEx = 12;
frameBack1.Width = Application.GetRealWidth(1034);
frameBack1.Height = Application.GetRealHeight(300);
frameBack1.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(frameBack1);
//UDP模式(推荐)
var btnUdp = new NormalViewControl(900, 156, true);
btnUdp.Gravity = Gravity.CenterHorizontal;
btnUdp.TextAlignment = TextAlignment.Center;
btnUdp.TextColor = 0xff0075ff;
btnUdp.TextSize = 17;
btnUdp.TextID = R.MyInternationalizationString.uUdpModeRecommend;
frameBack1.AddChidren(btnUdp, ChidrenBindMode.NotBind);
btnUdp.ButtonClickEvent += (sender, e) =>
{
//关闭界面
this.CloseForm();
var form = new WirelessUdpDirectionForm();
form.AddForm();
};
//线
var btnLine = new NormalViewControl(frameBack1.Width, ControlCommonResourse.BottomLineHeight, false);
btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
btnLine.Y = btnUdp.Bottom;
frameBack1.AddChidren(btnLine, ChidrenBindMode.NotBind);
//AP模式
var btnAp = new NormalViewControl(900, 144, true);
btnAp.Y = btnLine.Bottom;
btnAp.Gravity = Gravity.CenterHorizontal;
btnAp.TextAlignment = TextAlignment.Center;
btnAp.TextColor = 0xff0075ff;
btnAp.TextSize = 17;
btnAp.TextID = R.MyInternationalizationString.uApMode;
frameBack1.AddChidren(btnAp, ChidrenBindMode.NotBind);
btnAp.ButtonClickEvent += (sender, e) =>
{
//关闭界面
this.CloseForm();
var form = new WirelessApDirection1Form();
form.AddForm();
};
var frameBack2 = new FrameLayoutControl();
frameBack2.UseClickStatu = false;
frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(23);
frameBack2.Gravity = Gravity.CenterHorizontal;
frameBack2.RadiusEx = 12;
frameBack2.Width = Application.GetRealWidth(1034);
frameBack2.Height = Application.GetRealHeight(156);
frameBack2.BackgroundColor = UserCenterColor.Current.White;
bodyFrameLayout.AddChidren(frameBack2);
//取消
var btnCancel = new NormalViewControl(900, 156, true);
btnCancel.Gravity = Gravity.CenterHorizontal;
btnCancel.TextAlignment = TextAlignment.Center;
btnCancel.TextColor = 0xff0075ff;
btnCancel.TextSize = 17;
btnCancel.TextID = R.MyInternationalizationString.uCancel;
frameBack2.AddChidren(btnCancel, ChidrenBindMode.NotBind);
btnCancel.ButtonClickEvent += (sender, e) =>
{
//关闭界面
this.CloseForm();
};
}
}
}
}