using System;
|
using System.Collections.Generic;
|
using Shared;
|
using Shared.SimpleControl.R;
|
|
namespace Shared.SimpleControl.Phone.Music
|
{
|
class A31DeviceArgument : FrameLayout
|
{
|
public void Show (A31MusicModel a31)
|
{
|
|
AddChidren (new Button {
|
Height = Application.GetRealHeight (36),
|
BackgroundColor = SkinStyle.Current.MusicTopFrameLayout,
|
});
|
|
var topFrameLayout = new FrameLayout {
|
Height = Application.GetRealHeight (90),
|
Y = Application.GetRealHeight (36),
|
BackgroundColor = SkinStyle.Current.MusicTopFrameLayout,
|
};
|
AddChidren (topFrameLayout);
|
|
var btnTitle = new Button {
|
TextID = MyInternationalizationString.speakerinfo,
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//TextSize = 20,
|
//Text = "设备信息",
|
};
|
topFrameLayout.AddChidren (btnTitle);
|
|
var back = new Button {
|
Width = Application.GetRealWidth (82),
|
Height = Application.GetRealHeight (89),
|
X = Application.GetRealWidth (10),
|
Gravity = Gravity.CenterVertical,
|
UnSelectedImagePath = "MusicIcon/HomepageBack.png",
|
};
|
topFrameLayout.AddChidren (back);
|
back.MouseDownEventHandler += (sender, e) => {
|
RemoveFromParent ();
|
};
|
|
var hdl = new Button {
|
Width = Application.GetRealWidth (154),
|
Height = Application.GetRealHeight (90),
|
X = Application.GetRealWidth (486),
|
Gravity = Gravity.CenterVertical,
|
UnSelectedImagePath = MainPage.LogoString,
|
};
|
topFrameLayout.AddChidren (hdl);
|
|
var middle = new VerticalScrolViewLayout {
|
Y = topFrameLayout.Bottom,
|
Height = Application.GetRealHeight (Application.DesignHeight - 126),
|
BackgroundColor = SkinStyle.Current.MusicVerticalScrolViewLayout,
|
};
|
AddChidren (middle);
|
|
|
#region WI-FI网络信息
|
|
var devicelayout0 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
BackgroundColor = SkinStyle.Current.MusicMiddleBackgroundColor,
|
};
|
middle.AddChidren (devicelayout0);
|
var btntitle = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.lanstatus,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "WI-FI网络信息",
|
};
|
devicelayout0.AddChidren (btntitle);
|
|
#region IP
|
var devicelayout3 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout3);
|
var btnip = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "IP",
|
};
|
devicelayout3.AddChidren (btnip);
|
|
var btnipstr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 300),
|
TextAlignment = TextAlignment.CenterRight,
|
Width = Application.GetRealWidth (300),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = a31.IPAddress,
|
};
|
devicelayout3.AddChidren (btnipstr);
|
#endregion
|
|
#region MAC
|
var devicelayout4 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout4);
|
var btnmac = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "MAC",
|
};
|
devicelayout4.AddChidren (btnmac);
|
|
var btnmacstr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 300),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (300),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout4.AddChidren (btnmacstr);
|
#endregion
|
|
#endregion
|
|
|
#region Hotspot信息
|
|
var devicelayout5 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
BackgroundColor = SkinStyle.Current.MusicMiddleBackgroundColor,
|
};
|
middle.AddChidren (devicelayout5);
|
var btnhotspot = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.Hotspotstatus,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "Hotspot信息",
|
};
|
devicelayout5.AddChidren (btnhotspot);
|
|
|
#region SSID
|
var devicelayout6 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout6);
|
var btnssid = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "SSID",
|
};
|
devicelayout6.AddChidren (btnssid);
|
|
var btnssidstr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 300),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (300),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout6.AddChidren (btnssidstr);
|
#endregion
|
|
|
#region Personal Hotspot
|
var devicelayout7 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout7);
|
var btnPH = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "Personal Hotspot",
|
};
|
devicelayout7.AddChidren (btnPH);
|
|
var btnswitch = new Button {
|
Width = Application.GetMinRealAverage (90),
|
Height = Application.GetMinRealAverage (53),
|
UnSelectedImagePath = "Item/SwitchClose.png",
|
SelectedImagePath = "Item/SwitchOpen.png",
|
X = Application.GetRealWidth (640 - 90 - 30),
|
Gravity = Gravity.CenterVertical,
|
};
|
devicelayout7.AddChidren (btnswitch);
|
|
|
#endregion
|
|
#region Wi-Fi password
|
var devicelayout8 = new RowLayout {
|
Height = Application.GetRealHeight (320),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout8);
|
var btnWiFipassword = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "Wi-Fi password",
|
};
|
devicelayout8.AddChidren (btnWiFipassword);
|
|
var btnwifipassword = new Button {
|
Width = Application.GetRealWidth (290),
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (300),
|
Text = "",
|
TextAlignment = TextAlignment.CenterRight,
|
};
|
devicelayout8.AddChidren (btnwifipassword);
|
|
|
var btnWiFipasswordnext = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (550),
|
};
|
devicelayout8.AddChidren (btnWiFipasswordnext);
|
|
|
#region 提示语言文本Button...
|
var text1 = new Button {
|
Width = Application.GetRealWidth (400),
|
Height = Application.GetRealHeight (50),
|
X = Application.GetRealWidth (30),
|
Y = btnWiFipasswordnext.Bottom,
|
Text = "使用Wi-Fi连接",
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
devicelayout8.AddChidren (text1);
|
|
var text2 = new Button {
|
Width = Application.GetRealWidth (550),
|
Height = Application.GetRealHeight (50),
|
X = Application.GetRealWidth (30),
|
Y = text1.Bottom,
|
Text = "1.在你的设备或电脑的Wi-Fi设置中选择的",
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
devicelayout8.AddChidren (text2);
|
var text3 = new Button {
|
Width = Application.GetRealWidth (400),
|
Height = Application.GetRealHeight (50),
|
X = Application.GetRealWidth (30),
|
Y = text2.Bottom,
|
Text = "HDL开头连接",
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
devicelayout8.AddChidren (text3);
|
var text4 = new Button {
|
Width = Application.GetRealWidth (400),
|
Height = Application.GetRealHeight (50),
|
X = Application.GetRealWidth (30),
|
Y = text3.Bottom,
|
Text = "2.提示时输入密码",
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
devicelayout8.AddChidren (text4);
|
#endregion
|
string str = "";
|
bool IsStr = false;
|
btnswitch.MouseUpEventHandler += (sender, e) => {
|
btnswitch.IsSelected = !btnswitch.IsSelected;
|
if (btnswitch.IsSelected) {
|
btnWiFipasswordnext.UnSelectedImagePath = "MusicIcon/Next.png";
|
IsStr = true;
|
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=setHideSSID:0");
|
//System.Threading.Thread.Sleep (2000);
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
A31WifiPassword a31WifiPassword = new A31WifiPassword ();
|
MainPage.MainFrameLayout.AddChidren (a31WifiPassword);
|
a31WifiPassword.Show (str);
|
|
});
|
});
|
|
} else {
|
//btnWiFipasswordnext.UnSelectedImagePath = "MusicIcon/nexthidden.png";
|
btnWiFipasswordnext.Visible = false;
|
IsStr = false;
|
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=setHideSSID:2");
|
//System.Threading.Thread.Sleep (2000);
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
});
|
});
|
}
|
|
};
|
|
EventHandler<MouseEventArgs> pasclick = (sender, e) => {
|
if (IsStr) {
|
A31WifiPassword a31WifiPassword = new A31WifiPassword ();
|
MainPage.MainFrameLayout.AddChidren (a31WifiPassword);
|
a31WifiPassword.Show (str);
|
}
|
};
|
btnwifipassword.MouseUpEventHandler += pasclick;
|
btnWiFipasswordnext.MouseUpEventHandler += pasclick;
|
|
#endregion
|
#endregion
|
|
|
#region 其他信息
|
|
var devicelayout9 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
BackgroundColor = SkinStyle.Current.MusicMiddleBackgroundColor,
|
};
|
middle.AddChidren (devicelayout9);
|
var btntitlestr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.otherinformation,
|
Width = Application.GetRealWidth (300),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "其他信息",
|
};
|
devicelayout9.AddChidren (btntitlestr);
|
|
|
#region 音箱名称
|
var devicelayout10 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout10);
|
var btnplayername = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.speakername,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "音箱名称",
|
};
|
devicelayout10.AddChidren (btnplayername);
|
|
var btnname = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 350),
|
TextAlignment = TextAlignment.CenterRight,
|
Width = Application.GetRealWidth (350),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = a31.Name,
|
};
|
devicelayout10.AddChidren (btnname);
|
#endregion
|
|
#region 固件版本
|
var devicelayout11 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout11);
|
var btnfirmware = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.version,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "固件版本",
|
};
|
devicelayout11.AddChidren (btnfirmware);
|
//
|
var btnfirmwarestr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 350),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (350),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout11.AddChidren (btnfirmwarestr);
|
#endregion
|
|
#region 编译时间
|
var devicelayout12 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout12);
|
var btnRelease = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.builddate,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "编译时间",
|
};
|
devicelayout12.AddChidren (btnRelease);
|
|
var btnReleasestr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 350),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (350),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout12.AddChidren (btnReleasestr);
|
#endregion
|
|
#region UUID
|
var devicelayout13 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout13);
|
var btnuuid = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "UUID",
|
};
|
devicelayout13.AddChidren (btnuuid);
|
|
var btnuuidstr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 390),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (390),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout13.AddChidren (btnuuidstr);
|
#endregion
|
|
#region 提示音语言
|
var devicelayout14 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout14);
|
var btnlanguage = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.audiopromptslanguage,
|
Width = Application.GetRealWidth (350),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
// Text = "提示音语言",
|
};
|
devicelayout14.AddChidren (btnlanguage);
|
|
var btnlanguagestr = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (640 - 30 - 200 - 87),
|
TextAlignment = TextAlignment.CenterRight,
|
//TextID = MyInternationalizationString.equalizer,
|
Width = Application.GetRealWidth (200),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
Text = "",
|
};
|
devicelayout14.AddChidren (btnlanguagestr);
|
|
|
var btnlanguagenext = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
UnSelectedImagePath = "MusicIcon/Next.png",
|
SelectedImagePath = "MusicIcon/NextSelecte.png",
|
X = Application.GetRealWidth (550),
|
};
|
devicelayout14.AddChidren (btnlanguagenext);
|
|
|
EventHandler<MouseEventArgs> languageclick = (sender, e) => {
|
FrameLayout flMain = new FrameLayout { BackgroundColor = 0x00000000 };
|
this.AddChidren (flMain);
|
flMain.MouseUpEventHandler += (sender2, e2) => {
|
flMain.RemoveFromParent ();
|
};
|
|
var frameLayout = new FrameLayout {
|
Y = Application.GetRealHeight (Application.DesignHeight - 470),
|
Height = Application.GetRealHeight (320),
|
Width = Application.GetRealWidth (580),
|
BackgroundColor = 0xffffffff,
|
X = Application.GetRealWidth (30),
|
};
|
flMain.AddChidren (frameLayout);
|
|
var titlerow = new RowLayout {
|
Height = Application.GetRealHeight (120),
|
};
|
frameLayout.AddChidren (titlerow);
|
var titlebtn = new Button {
|
//Text = "更改设备语言",
|
TextID = MyInternationalizationString.devicelanguage,
|
TextSize = 16,
|
TextColor = SkinStyle.Current.MusicTipTextColor,
|
TextAlignment = TextAlignment.Center,
|
};
|
titlerow.AddChidren (titlebtn);
|
|
var zhrow = new RowLayout {
|
Y = titlerow.Bottom,
|
Height = Application.GetRealHeight (100),
|
BackgroundColor = 0xffcccccc,
|
};
|
frameLayout.AddChidren (zhrow);
|
var bntzh = new Button {
|
TextID = MyInternationalizationString.Chinese,
|
//Text = "中文",
|
TextColor = SkinStyle.Current.MusicTipTextColor,
|
TextAlignment = TextAlignment.Center,
|
};
|
zhrow.AddChidren (bntzh);
|
|
EventHandler<MouseEventArgs> zhclick = (sender13, e13) => {
|
flMain.RemoveFromParent ();
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=setLanguage:zh_cn");
|
//System.Threading.Thread.Sleep (2000);
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
});
|
});
|
};
|
zhrow.MouseUpEventHandler += zhclick;
|
bntzh.MouseUpEventHandler += zhclick;
|
|
var enrow = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
Y = zhrow.Bottom,
|
BackgroundColor = 0xffcccccc,
|
};
|
frameLayout.AddChidren (enrow);
|
var btnen = new Button {
|
TextID = MyInternationalizationString.english,
|
//Text = "英文",
|
TextColor = SkinStyle.Current.MusicTipTextColor,
|
TextAlignment = TextAlignment.Center,
|
|
};
|
enrow.AddChidren (btnen);
|
|
EventHandler<MouseEventArgs> enclick = (sender13, e13) => {
|
flMain.RemoveFromParent ();
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=setLanguage:en_us");
|
//System.Threading.Thread.Sleep (2000);
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
MainPage.MainFrameLayout.RemoveAt (MainPage.MainFrameLayout.ChildrenCount - 1);
|
});
|
});
|
};
|
btnen.MouseUpEventHandler += enclick;
|
enrow.MouseUpEventHandler += enclick;
|
|
var frameLayout1 = new FrameLayout {
|
Y = Application.GetRealHeight (Application.DesignHeight - 130),
|
Height = Application.GetRealHeight (100),
|
Width = Application.GetRealWidth (580),
|
BackgroundColor = 0xffffffff,
|
X = Application.GetRealWidth (30),
|
};
|
flMain.AddChidren (frameLayout1);
|
var cancelbtn = new Button {
|
TextID = MyInternationalizationString.cancel,
|
Height = Application.GetRealHeight (100),
|
TextColor = SkinStyle.Current.MusicTipTextColor,
|
TextSize = 16,
|
};
|
frameLayout1.AddChidren (cancelbtn);
|
cancelbtn.MouseUpEventHandler += (sender4, e4) => {
|
flMain.RemoveFromParent ();
|
};
|
|
|
|
|
};
|
devicelayout14.MouseUpEventHandler += languageclick;
|
btnlanguage.MouseUpEventHandler += languageclick;
|
btnlanguagestr.MouseUpEventHandler += languageclick;
|
btnlanguagenext.MouseUpEventHandler += languageclick;
|
#endregion
|
|
#region 恢复出厂设置
|
var devicelayout15 = new RowLayout {
|
Height = Application.GetRealHeight (100),
|
LineColor = SkinStyle.Current.MusicRowLayoutLineColor,
|
};
|
middle.AddChidren (devicelayout15);
|
var btnset = new Button {
|
Height = Application.GetRealHeight (100),
|
X = Application.GetRealWidth (30),
|
TextAlignment = TextAlignment.CenterLeft,
|
TextID = MyInternationalizationString.restorfactorysettings,
|
Width = Application.GetRealWidth (350),
|
TextColor = SkinStyle.Current.MusicTextColor,
|
//Text = "恢复出厂设置",
|
};
|
devicelayout15.AddChidren (btnset);
|
|
var btnsetnext = new Button {
|
Width = Application.GetRealWidth (87),
|
Height = Application.GetRealHeight (100),
|
UnSelectedImagePath = "MusicIcon/Next.png",
|
SelectedImagePath = "MusicIcon/NextSelecte.png",
|
X = Application.GetRealWidth (550),
|
};
|
devicelayout15.AddChidren (btnsetnext);
|
EventHandler<MouseEventArgs> setclick = (sender, e) => {
|
|
Dialog window = new Dialog ();
|
window.Show ();
|
|
var frameLayout = new FrameLayout {
|
Width = Application.GetRealWidth (580),
|
Height = Application.GetRealHeight (250),
|
X = Application.GetRealWidth (30),
|
Y = Application.GetRealHeight (450),
|
BackgroundColor = 0xffffffff,
|
};
|
window.AddChidren (frameLayout);
|
|
var Modifyname = new Button {
|
Width = Application.GetRealWidth (580),
|
Height = Application.GetRealHeight (80),
|
TextID = MyInternationalizationString.restorfactorysettings,
|
//Text = "恢复出厂设置",
|
Y = Application.GetRealHeight (30),
|
TextSize = 16,
|
TextColor = SkinStyle.Current.MusicTipTextColor,
|
};
|
frameLayout.AddChidren (Modifyname);
|
|
var ther1 = new Button {
|
Height = Application.GetRealHeight (2),
|
Y = Application.GetRealHeight (218 - 50),
|
BackgroundColor = 0xff666666,
|
};
|
frameLayout.AddChidren (ther1);
|
|
var cancelrow = new RowLayout {
|
Y = Application.GetRealHeight (220 - 50),
|
Height = Application.GetRealHeight (80),
|
Width = Application.GetRealWidth (289),
|
BackgroundColor = 0xffcccccc,
|
};
|
frameLayout.AddChidren (cancelrow);
|
|
var cancel = new Button {
|
TextID = MyInternationalizationString.cancel,
|
TextSize = 18,
|
TextColor = SkinStyle.Current.MusicTextColor,
|
};
|
cancelrow.AddChidren (cancel);
|
cancel.MouseUpEventHandler += (sender1, e1) => {
|
window.Close ();
|
};
|
|
var ther = new Button {
|
Y = Application.GetRealHeight (220 - 50),
|
Height = Application.GetRealHeight (80),
|
Width = Application.GetRealWidth (2),
|
X = Application.GetRealHeight (289),
|
BackgroundColor = 0xff666666,
|
};
|
frameLayout.AddChidren (ther);
|
|
var confirmrow = new RowLayout {
|
Y = Application.GetRealHeight (220 - 50),
|
X = Application.GetRealWidth (291),
|
Height = Application.GetRealHeight (80),
|
Width = Application.GetRealWidth (289),
|
BackgroundColor = 0xffcccccc,
|
};
|
frameLayout.AddChidren (confirmrow);
|
|
var confirm = new Button {
|
TextID = MyInternationalizationString.confirm,
|
TextSize = 18,
|
TextColor = SkinStyle.Current.MusicTextColor,
|
};
|
confirmrow.AddChidren (confirm);
|
confirm.MouseUpEventHandler += (sender12, e12) => {
|
window.Close ();
|
MainPage.Loading.Start (Language.StringByID (MyInternationalizationString.load));
|
System.Threading.Tasks.Task.Run (() => {
|
openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=restoreToDefault");
|
//System.Threading.Thread.Sleep (2000);
|
Application.RunOnMainThread (() => {
|
MainPage.Loading.Hide ();
|
this.Parent.RemoveAt (Parent.ChildrenCount - 4);
|
this.Parent.RemoveAt (Parent.ChildrenCount - 3);
|
this.Parent.RemoveAt (Parent.ChildrenCount - 2);
|
this.RemoveFromParent ();
|
|
UserMiddle.DevicePageView.PageIndex = 0;
|
var myMusic = new MyMusic ();
|
UserMiddle.DevicePageView.AddChidren (myMusic);
|
myMusic.Show (true);
|
UserMiddle.DevicePageView.PageIndex = 1;
|
|
});
|
});
|
};
|
|
};
|
devicelayout15.MouseUpEventHandler += setclick;
|
btnset.MouseUpEventHandler += setclick;
|
btnsetnext.MouseUpEventHandler += setclick;
|
#endregion
|
#endregion
|
|
var statusEx = openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=getStatusEx");
|
if (statusEx == null) {
|
statusEx = openWeb ("http://" + a31.IPAddress + "/httpapi.asp?command=getStatusEx");
|
}
|
if (statusEx == null) {
|
return;
|
}
|
var serverIfon = Newtonsoft.Json.JsonConvert.DeserializeObject<a31wifi> (statusEx);
|
if (serverIfon != null) {
|
//btnipstr.Text = a31.IPAddress;
|
//btnname.Text = a31.Name;
|
btnmacstr.Text = serverIfon.MAC;
|
btnssidstr.Text = serverIfon.ssid;
|
btnfirmwarestr.Text = serverIfon.firmware;
|
btnReleasestr.Text = serverIfon.Release;
|
btnuuidstr.Text = serverIfon.uuid;
|
btnlanguagestr.Text = serverIfon.language.ToUpper ();
|
btnwifipassword.Text = serverIfon.psk;
|
str = serverIfon.psk;
|
if (serverIfon.SSIDStrategy == "0") {
|
btnswitch.IsSelected = true;
|
btnWiFipasswordnext.UnSelectedImagePath = "MusicIcon/Next.png";
|
IsStr = true;
|
} else {
|
btnWiFipasswordnext.UnSelectedImagePath = "MusicIcon/nexthidden.png";
|
IsStr = false;
|
}
|
|
if (Language.CurrentLanguage == "English") {
|
text1.Text = "To Connect Using Wi-Fi";
|
text2.Text = "1.Choose " + serverIfon.ssid + " in your Wi-Fi settings";
|
text3.Text = "on your device or computer.";
|
text4.Text = "Enter the password when prompted.";
|
|
} else {
|
text1.Text = "使用Wi-Fi连接";
|
text2.Text = "1.在你的设备或电脑的Wi-Fi设置中选择的";
|
text3.Text = serverIfon.ssid;
|
text4.Text = "2.提示时输入密码";
|
}
|
|
}
|
|
}
|
|
string openWeb (string url)
|
{
|
try {
|
var webClient = new Shared.Net.MyWebClient (2000);
|
return webClient.DownloadString (url);
|
} catch (Exception e) {
|
System.Console.WriteLine (e.Message);
|
return null;
|
}
|
}
|
}
|
}
|