using System; using System.Collections.Generic; using System.Text; using ZigBee.Device; namespace Shared.Phone.UserCenter { /// /// 设备信息界面的设备图标控件 /// public class DeviceInfoIconControl : FrameLayout { #region ■ 变量声明___________________________ /// /// 设备Mac地址 /// private string deviceMac = string.Empty; /// /// 设备端点 /// private int deviceEpoint = 0; /// /// 图标控件 /// private NormalViewControl btnIcon = null; #endregion #region ■ 初始化_____________________________ /// /// 设备信息界面的设备图标控件 /// /// 设备回路对象 public DeviceInfoIconControl(CommonDevice i_device) { deviceMac = i_device.DeviceAddr; deviceEpoint = i_device.DeviceEpoint; //第一层底色 this.Height = Application.GetMinRealAverage(207); this.Width = Application.GetMinRealAverage(207); this.BackgroundColor = UserCenterColor.Current.White; this.Radius = (uint)Application.GetMinRealAverage(207); } /// /// 初始化 /// public void InitControl() { //第二层底色 var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false); btnIcon2.BackgroundColor = 0xfffef1ed; btnIcon2.Radius = (uint)Application.GetMinRealAverage(184); btnIcon2.Gravity = Gravity.Center; this.AddChidren(btnIcon2); //设备图标 btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false); btnIcon.Gravity = Gravity.Center; Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, Common.LocalDevice.Current.GetDevicesByMac(deviceMac)); this.AddChidren(btnIcon); } #endregion #region ■ 一般方法___________________________ /// /// 重新刷新控件 /// public void RefreshControl() { //刷新图标 Common.LocalDevice.Current.SetDeviceBeloneIconToControl(btnIcon, Common.LocalDevice.Current.GetDevicesByMac(deviceMac)); } #endregion } }