using System; using System.Collections.Generic; namespace Shared.SimpleControl.Pad { public class MonitorType : Dialog { public static MonitorType curView; VerticalScrolViewLayout middleVerticalScrolViewLayout; public MonitorType () { showVideoMonitoring (); } void showVideoMonitoring () { #region 标题 var topView = new FrameLayout () { Height = Application.GetRealHeight (130), BackgroundColor = 0xff000000, }; AddChidren (topView); var title = new Button () { TextAlignment = TextAlignment.Center, Text = Language.StringByID (R.MyInternationalizationString.VideoMonitoring), TextSize = 19, Y = Application.GetRealHeight (10), }; topView.AddChidren (title); var back = new Button () { Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (85), UnSelectedImagePath = "Item/Back.png", SelectedImagePath = "Item/BackSelected.png", Y = Application.GetRealHeight (30), X = Application.GetRealWidth (10), }; topView.AddChidren (back); back.MouseUpEventHandler += (sender, e) => { Close (); }; var btnl = new Button () { Height = 1, BackgroundColor = 0xFF2F2F2F, Y = topView.Height - 1 }; topView.AddChidren (btnl); #endregion var BodyView = new VerticalScrolViewLayout () { Y = topView.Bottom, Height = Application.GetRealHeight (Application.DesignHeight - 126), BackgroundColor = 0xFF2f2f2f, }; AddChidren (BodyView); for (int i = 0; i < 2; i++) { var RowView = new FrameLayout () { Height = Application.GetRealHeight (110), BackgroundColor = 0xFF2f2f2f, }; BodyView.AddChidren (RowView); var btnIcon = new Button () { Width = Application.GetRealHeight (13), Height = Application.GetRealHeight (13), X = Application.GetRealWidth (50), UnSelectedImagePath = "Item/Point.png", SelectedImagePath = "Item/PointSelected.png", Gravity = Gravity.CenterVertical, }; RowView.AddChidren (btnIcon); var monitorName = new Button () { X = btnIcon.Right + Application.GetRealWidth (40), Width = Application.GetRealWidth (300), Height = Application.GetRealHeight (110), TextAlignment = TextAlignment.CenterLeft, }; RowView.AddChidren (monitorName); if (i == 0) { monitorName.TextID = R.MyInternationalizationString.EZVIZ; } else if (i == 1) { monitorName.TextID = R.MyInternationalizationString.URL; } var btnRight = new Button () { Width = Application.GetRealWidth (28), Height = Application.GetRealHeight (40), X = monitorName.Right + Application.GetRealWidth (1520), UnSelectedImagePath = "Item/Right.png", SelectedImagePath = "Item/RightSelected.png", Gravity = Gravity.CenterVertical, }; RowView.AddChidren (btnRight); var line2 = new Button () { Y = RowView.Height - 1, Height = 2, BackgroundColor = 0xFF000000, }; RowView.AddChidren (line2); int currentIndex = i; EventHandler eHandler = (sender, e) => { for (int j = 0; j < BodyView.ChildrenCount; j++) { var rowView = BodyView.GetChildren (j); } if (currentIndex == 0) { if (Application.DeviceType == Device.Ios) { //初始化萤石库 EZMonitor.Ezviz.LibInit (); //跳转到萤石摄像头 EZMonitor.CommonList.AddEzvizMonitor (); //Com.Hdl.ON.CommonList.Go2EZvizMonitor (); } else { //Shared.Ezviz.OpenEzviz ("com.hdl.ezviz"); } } else if (currentIndex == 1) { new URLMonitor ().Show (); } }; btnRight.MouseUpEventHandler += eHandler; btnIcon.MouseUpEventHandler += eHandler; RowView.MouseUpEventHandler += eHandler; monitorName.MouseUpEventHandler += eHandler; } } } }