using Shared.SimpleControl.Phone; using System; using System.Collections.Generic; using System.Text; namespace Shared.SimpleControl.Pad { public class UserTVCustomChannel : FrameLayout { FrameLayout LongPressFrameLayout = new FrameLayout (); public void Show (InfraredMode infraredTV) { #region bodyView FrameLayout BodyView = new FrameLayout () { }; this.AddChidren (BodyView); VerticalScrolViewLayout tvBodyView = new VerticalScrolViewLayout (); BodyView.AddChidren (tvBodyView); FrameLayout tvRowView = null; if (infraredTV.InfraredCustomChannel == null) { infraredTV.InfraredCustomChannel = new List (); } for (int index = 0; index <= infraredTV.InfraredCustomChannel.Count; index++) { if (index % 3 == 0) { tvRowView = new FrameLayout () { Height = Application.GetRealHeight (250), }; tvBodyView.AddChidren (tvRowView); } var tvView = new FrameLayout () { X = Application.GetRealWidth(40), Y = Application.GetRealHeight(30), Width = Application.GetRealWidth (300), Height = Application.GetRealHeight(220), Alpha = 0.8f, }; tvRowView.AddChidren (tvView); if (index % 3 == 1) { tvView.X = Application.GetRealWidth (350); } else if (index % 3 == 2) { tvView.X = Application.GetRealWidth (660); } if (index == infraredTV.InfraredCustomChannel.Count) { tvView.BackgroundImagePath = "Item/SceneAdd.png"; tvView.MouseUpEventHandler += (sender, e) => { var tv3 = new UserTVAddCustomChannel () { BackgroundColor = 0xFF2f2f2f, Width = Application.GetRealWidth (840), Height = Application.GetRealHeight (1100), }; tv3.Show (); tv3.Show (infraredTV, MyRefresh); }; } else { InfraredCustomChannel icc = infraredTV.InfraredCustomChannel [index]; var btnBGC = new Button () { UnSelectedImagePath = icc.ChannelIconPath, TextAlignment = TextAlignment.BottomCenter, Text = icc.ChannelName, TextColor = SkinStyle.Current.TextColor1, TextSize = 15, Tag = index, }; tvView.AddChidren (btnBGC); btnBGC.MouseUpEventHandler += (sender, e) => { infraredTV.InfraredCustomChannel [int.Parse (btnBGC.Tag.ToString ())].Send (); }; btnBGC.MouseLongEventHandler += (sender, e) => { Alert alert = new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.SureDelete), Language.StringByID (R.MyInternationalizationString.Cancel), Language.StringByID (R.MyInternationalizationString.Confrim)); alert.Show (); alert.ResultEventHandler += (sender2, e2) => { if (e2) { infraredTV.InfraredCustomChannel.Remove (icc); IO.FileUtils.SaveEquipmentMessage (infraredTV, infraredTV.LoopID.ToString ()); MyRefresh (infraredTV); } }; }; } } #endregion //MyRefresh (infraredTV); } public void MyRefresh (InfraredMode infraredTV ) { this.RemoveAll (); Show (infraredTV); } } }