| | |
| | | /// 撤防
|
| | | /// </summary>
|
| | | private GarrisonControl btnReGarrisonGarrison = null;
|
| | | /// <summary>
|
| | | /// 桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | | this.Width = Application.GetRealWidth(964);
|
| | | this.Height = Application.GetRealHeight(340);
|
| | | this.Radius = 20;
|
| | | this.BackgroundColor = UserCenterColor.Current.White;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | this.btnReGarrisonGarrison = null;
|
| | | this.btnRemovehomeGarrison = null;
|
| | |
|
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Height = this.Height;
|
| | | frameTable.Width = this.Width;
|
| | | frameTable.Radius = (uint)Application.GetRealHeight(58);
|
| | | frameTable.BackgroundColor = UserCenterColor.Current.White;
|
| | | this.AddChidren(frameTable);
|
| | |
|
| | | //右上圆角背景
|
| | | var btnTopRight = new NormalViewControl(50, 50, true);
|
| | | var btnTopRight = new NormalViewControl(150, 60, true);
|
| | | btnTopRight.BackgroundColor = UserCenterColor.Current.White;
|
| | | btnTopRight.Radius = 6;
|
| | | btnTopRight.RadiusEx = 17;
|
| | | this.AddChidren(btnTopRight);
|
| | | btnTopRight.X = this.Width - btnTopRight.Width;
|
| | |
|
| | | //左下圆角背景
|
| | | var btnBottomRight = new NormalViewControl(50, 50, true);
|
| | | var btnBottomRight = new NormalViewControl(150, 60, true);
|
| | | btnBottomRight.BackgroundColor = UserCenterColor.Current.White;
|
| | | btnBottomRight.Radius = 6;
|
| | | btnBottomRight.RadiusEx = 17;
|
| | | this.AddChidren(btnBottomRight);
|
| | | btnBottomRight.Y = this.Height - btnBottomRight.Height;
|
| | |
|
| | |
| | | {
|
| | | //在家布防
|
| | | btnAthomeGarrison = new GarrisonControl();
|
| | | this.AddChidren(btnAthomeGarrison);
|
| | | frameTable.AddChidren(btnAthomeGarrison);
|
| | | btnAthomeGarrison.InitControl(GarrisonMode.AtHome);
|
| | | btnAthomeGarrison.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | //离家布防
|
| | | btnRemovehomeGarrison = new GarrisonControl();
|
| | | btnRemovehomeGarrison.X = btnAthomeGarrison.Right + Application.GetRealWidth(32);
|
| | | this.AddChidren(btnRemovehomeGarrison);
|
| | | frameTable.AddChidren(btnRemovehomeGarrison);
|
| | | btnRemovehomeGarrison.InitControl(GarrisonMode.RemoveHome);
|
| | | btnRemovehomeGarrison.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | //撤防
|
| | | btnReGarrisonGarrison = new GarrisonControl();
|
| | | btnReGarrisonGarrison.X = btnRemovehomeGarrison.Right + Application.GetRealWidth(32);
|
| | | this.AddChidren(btnReGarrisonGarrison);
|
| | | frameTable.AddChidren(btnReGarrisonGarrison);
|
| | | btnReGarrisonGarrison.InitControl(GarrisonMode.RemoveGarrison);
|
| | | btnReGarrisonGarrison.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | //布防
|
| | | btnAthomeGarrison = new GarrisonControl();
|
| | | btnAthomeGarrison.X = Application.GetRealWidth(166);
|
| | | this.AddChidren(btnAthomeGarrison);
|
| | | frameTable.AddChidren(btnAthomeGarrison);
|
| | | btnAthomeGarrison.InitControl(GarrisonMode.AtHome);
|
| | | btnAthomeGarrison.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | //撤防
|
| | | btnReGarrisonGarrison = new GarrisonControl();
|
| | | btnReGarrisonGarrison.X = btnAthomeGarrison.Right + Application.GetRealWidth(32);
|
| | | this.AddChidren(btnReGarrisonGarrison);
|
| | | frameTable.AddChidren(btnReGarrisonGarrison);
|
| | | btnReGarrisonGarrison.InitControl(GarrisonMode.RemoveGarrison);
|
| | | btnReGarrisonGarrison.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 布防撤防___________________________ |
| | | #region ■ 布防撤防___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 在家布防
|
| | | /// </summary> |
| | | /// </summary>
|
| | | private async void SetSafetyGarrisonModeInAtHome()
|
| | | {
|
| | | //打开进度条
|
| | |
| | | //如果设置有内部防区
|
| | | string msg = string.Empty;
|
| | | if (HdlSafeguardLogic.Current.IsHadInternalDefenseArea() == true)
|
| | | |
| | | {
|
| | | {
|
| | | //在家布防设置成功
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uSetAtHomeGarrisonSuccess);
|
| | | }
|
| | |
| | | //布防设置成功
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uSetGarrisonSuccess);
|
| | | }
|
| | |
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | //添加布防上报的行控件
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | form?.AddSafeguardLogPushRow(null);
|
| | | }
|
| | | else
|
| | | {
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | }
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | });
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 离家布防
|
| | | /// </summary> |
| | | /// </summary>
|
| | | private async void SetSafetyGarrisonModeInRemoveHome()
|
| | | {
|
| | | //打开进度条
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | //添加布防上报的行控件
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | form?.AddSafeguardLogPushRow(null);
|
| | | }
|
| | | else
|
| | | {
|
| | | //离家布防设置成功
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetRemoveHomeGarrisonSuccess);
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | }
|
| | | //离家布防设置成功
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetRemoveHomeGarrisonSuccess);
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | });
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 撤防
|
| | | /// </summary> |
| | | /// </summary>
|
| | | private async void RemoveSafetyGarrisonMode()
|
| | | {
|
| | | //打开进度条
|
| | |
| | | //根据布防模式,设置图标的选择状态
|
| | | this.SetIconStatuByGarrisonMode(GarrisonMode.RemoveGarrison);
|
| | |
|
| | | if (UserCenterResourse.DicActionForm.ContainsKey("SafetyManagementMainForm") == true)
|
| | | {
|
| | | //添加布防上报的行控件
|
| | | var form = (Safety.SafetyManagementMainForm)UserCenterResourse.DicActionForm["SafetyManagementMainForm"];
|
| | | form?.AddSafeguardLogPushRow(null);
|
| | | }
|
| | | else
|
| | | {
|
| | | //离家布防设置成功
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess);
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | }
|
| | | //离家布防设置成功
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonSuccess);
|
| | | var control = new ShowMsgControl(ShowMsgType.Tip, msg);
|
| | | control.Show();
|
| | | });
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据布防模式,设置图标的选择状态
|
| | | /// </summary>
|
| | | /// <param name="mode"></param> |
| | | /// <param name="mode"></param>
|
| | | public void SetIconStatuByGarrisonMode(GarrisonMode mode)
|
| | | {
|
| | | //在家布防
|
| | |
| | |
|
| | | /// <summary>
|
| | | /// 设置布防按钮的可视状态
|
| | | /// </summary> |
| | | /// </summary>
|
| | | public void SetButtonVisible()
|
| | | {
|
| | | //设置有内部防区
|
| | |
| | | /// <summary>
|
| | | /// 封装的布防控件
|
| | | /// </summary>
|
| | | private class GarrisonControl : FrameLayoutControl
|
| | | private class GarrisonControl : FrameLayoutStatuControl
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | this.RemoveBaseClickEvent();
|
| | |
|
| | | //背景
|
| | | int backHeight = Application.GetMinRealAverage(132);
|
| | | int backHeight = this.GetPictrueRealSize(132);
|
| | | btnBack = new NormalViewControl(backHeight, backHeight, false);
|
| | | btnBack.Gravity = Gravity.CenterHorizontal;
|
| | | btnBack.Radius = (uint)backHeight / 2;
|
| | | btnBack.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | this.AddChidren(btnBack, ChidrenBindMode.BindEventOnly);
|
| | | this.AddChidren(btnBack, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //图标
|
| | | btnIcon = new IconViewControl(81);
|
| | | btnIcon.Y = Application.GetRealHeight(26);
|
| | | btnIcon.Gravity = Gravity.CenterHorizontal;
|
| | | this.AddChidren(btnIcon, ChidrenBindMode.BindEventOnly);
|
| | | this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //文本
|
| | | btnText = new NormalViewControl(this.Width, Application.GetRealHeight(58), false);
|