//using System; //using System.Collections.Generic; //namespace Shared.SimpleControl.Phone //{ // public class SystemDryContactPanel: Common // { // public void SystemDryContactPanelShow (DryContact dcp, Common common) // { // //SystemMiddle.VerticalScrolViewMiddle.RemoveAll (); // #region top // RowLayout frameLayout = new RowLayout () { // Height = Application.GetRealHeight (100), // Width = LayoutParams.MatchParent, // BackgroundColor = SkinStyle.Current.MainColor // }; // SystemMiddle.VerticalScrolViewMiddle.AddChidren (frameLayout); // Button backButton = new Button () { // X = Application.GetRealWidth (0), // Height = Application.GetRealHeight (90), // Width = Application.GetRealWidth (85), // UnSelectedImagePath = "Item/Back.png", // SelectedImagePath = "Item/BackSelected.png", // Gravity = Gravity.CenterVertical, // }; // backButton.MouseUpEventHandler += (sender, e) => { // new SystemEquipmentBase ().EquipmentBaseViewShow (common); // //SystemMiddle.VerticalScrolViewMiddle.Animate = Animate.RightToLeft; // }; // frameLayout.AddChidren (backButton); // EditText textButton = new EditText () { // X = Application.GetRealWidth (30) + backButton.Right, // Height = Application.GetRealHeight (50), // Width = Application.GetRealWidth (400), // Text = dcp.Name, // Gravity = Gravity.CenterVertical, // TextAlignment = TextAlignment.CenterLeft, // SelectedBackgroundColor = SkinStyle.Current.SysEditBox, // TextColor = SkinStyle.Current.TextColor1 // }; // frameLayout.AddChidren (textButton); // Button editor = new Button () { // Height = Application.GetRealHeight (90), // Width = Application.GetRealWidth (70), // UnSelectedImagePath = "Item/Editor.png", // SelectedImagePath = "Item/EditorSelected.png", // Gravity = Gravity.CenterVertical, // }; // editor.X = frameLayout.Width - editor.Width - Application.GetRealWidth (30); // if (common.isMixBox == false) // frameLayout.AddChidren (editor); // editor.MouseUpEventHandler += (sender, e) => { // if (editor.IsSelected) { // MainPage.Loading.Start (); // editor.IsSelected = textButton.IsSelected = textButton.Enable = false; // byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (textButton.Text.Trim ()); // textButton.IsSelected = editor.IsSelected = textButton.Enable = false; // System.Threading.Tasks.Task.Run (() => { // byte [] updateBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, dcp.SubnetID, dcp.DeviceID, new byte [] { // dcp.BigClass,dcp.MinClass,dcp.LoopID // }); // if (updateBytes == null) { // Application.RunOnMainThread (() => { // new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipEquipmentNotOnline), Language.StringByID (R.MyInternationalizationString.Close)).Show (); // MainPage.Loading.Hide (); // }); // return; // } // byte [] uBytes = new byte [20]; // Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length< 20 ? remakeBytes.Length : 20); // Array.Copy (uBytes, 0, updateBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length); // var reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, dcp.SubnetID, dcp.DeviceID, updateBytes); // if (reBytes != null) { // Application.RunOnMainThread (() => { // dcp.Name = textButton.Text.Trim (); // IO.FileUtils.SaveEquipmentMessage (dcp, dcp.LoopID.ToString ()); // MainPage.Loading.Hide (); // }); // } else { // Application.RunOnMainThread (() => { // new Alert (Language.StringByID (R.MyInternationalizationString.Tip), Language.StringByID (R.MyInternationalizationString.TipEquipmentNotOnline), Language.StringByID (R.MyInternationalizationString.Close)).Show (); // MainPage.Loading.Hide (); // }); // } // }); // } else { // textButton.Enable = textButton.IsSelected = editor.IsSelected = true; // } // }; // #endregion // #region MyRegion // FrameLayout frameLayoutBody = new FrameLayout () { // Height = Application.GetRealHeight (798), // Width = LayoutParams.MatchParent, // }; // SystemMiddle.VerticalScrolViewMiddle.AddChidren (frameLayoutBody); // //---output test // Button btnOutput = new Button () { // Width = Application.GetRealWidth (203), // Height = Application.GetRealHeight (23), // X = Application.GetRealWidth (60), // Y = Application.GetRealHeight (40), // TextID = R.MyInternationalizationString.CurrentStatus, // TextAlignment = TextAlignment.CenterLeft, // }; // frameLayoutBody.AddChidren (btnOutput); // Button btnSwitch = new Button () { // Width = Application.GetRealWidth (208), // Height = Application.GetRealHeight (208), // Gravity = Gravity.CenterHorizontal, // Y = btnOutput.Bottom + Application.GetRealHeight (30), // TextAlignment = TextAlignment.Center, // UnSelectedImagePath = "Item/DryContact.png", // SelectedImagePath = "Item/DryContactSelected.png" // }; // if (dcp.Status == 0) // btnSwitch.IsSelected = false; // else // btnSwitch.IsSelected = true; // frameLayoutBody.AddChidren (btnSwitch); // #endregion // } // } //}