using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using ZigBee.Device;
namespace Shared.Phone.UserCenter.UserMain
{
///
/// 消息中心
///
public class MessageManagementForm : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 列表控件
///
private VerticalFrameRefreshControl listView = null;
///
/// 全部的行,主键是自动递增的东西
///
private Dictionary dicAllRow = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
public void ShowForm()
{
//左滑使能
this.ScrollEnabled = false;
Common.CommonPage.Instance.IsDrawerLockMode = true;
//设置头部信息
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uMessageCenter));
//初始化右上角菜单
this.InitTopRightMenu();
listView = new VerticalFrameRefreshControl(35);
listView.Height = bodyFrameLayout.Height;
bodyFrameLayout.AddChidren(listView);
listView.BeginHeaderRefreshingAction += () =>
{
HdlThreadLogic.Current.RunThread(() =>
{
//初始化中部信息
this.InitMiddleData(false);
});
};
HdlThreadLogic.Current.RunThread(() =>
{
//打开进度条
this.ShowProgressBar();
//初始化中部信息
this.InitMiddleData(true);
});
}
///
/// 初始化中部信息
///
private void InitMiddleData(bool showReload)
{
//获取数据
var dicData = this.GetMessageData();
if (dicData == null)
{
if (showReload == true)
{
//关闭进度条
this.CloseProgressBar(ShowReLoadMode.YES);
}
else
{
//关闭进度条
this.CloseProgressBar();
}
HdlThreadLogic.Current.RunMain(() =>
{
//关闭刷新特效
listView?.EndHeaderRefreshing();
//清空
listView.RemoveAll();
});
//数据异常
return;
}
if (this.Parent == null)
{
return;
}
HdlThreadLogic.Current.RunMain(() =>
{
//清空
listView.RemoveAll();
});
if (dicData.Count == 0)
{
//关闭进度条
this.CloseProgressBar();
HdlThreadLogic.Current.RunMain(() =>
{
//关闭刷新特效
listView.EndHeaderRefreshing();
listView.frameTable.Height = listView.Height;
});
return;
}
//初始化中部控件
this.InitMiddleFrame(dicData);
}
///
/// 初始化中部控件(要使用线程调用)
///
///
private void InitMiddleFrame(Dictionary>> dicData)
{
int dateIndex = 0;
FrameListControl framBack = null;
string oldKeys = string.Empty;
int maxCount = 0;
int countIndex = 0;
foreach (var data in dicData.Values)
{
//获取循环的总次数
maxCount += data.Count;
}
int waiTime = 500;
foreach (var keys in dicData.Keys)
{
var listGroup = dicData[keys];
foreach (var listData in listGroup)
{
HdlThreadLogic.Current.RunMain(() =>
{
countIndex++;
//当日期不一样时,重新建立桌布
if (oldKeys != keys)
{
oldKeys = keys;
dateIndex++;
//容器
framBack = new FrameListControl(23);
framBack.Name = dateIndex.ToString();
framBack.Height = Application.GetRealHeight(100);
framBack.BackgroundColor = UserCenterColor.Current.White;
listView.AddChidren(framBack);
//日期
string strMonth = Language.StringByID(R.MyInternationalizationString.Month);
string strDate = Language.StringByID(R.MyInternationalizationString.Day);
var frameDate = new FrameLayout();
frameDate.Height = Application.GetRealHeight(118);
framBack.AddChidren(frameDate);
var btnDate = new NormalViewControl(500, 60, true);
btnDate.TextSize = 15;
btnDate.X = ControlCommonResourse.XXLeft;
btnDate.Y = Application.GetRealHeight(35);
btnDate.Text = Convert.ToDateTime(listGroup[0][0].CreatedOnUtc).ToString("MM" + strMonth + "dd" + strDate);
frameDate.AddChidren(btnDate);
}
for (int i = 0; i < listData.Count; i++)
{
//一条信息里面,它可能包含多个报警
for (int j = 0; j < listData[i].listMsg.Count; j++)
{
//设置已读的初始值
listData[i].ListReading.Add(listData[i].IsReading);
//添加信息行
bool addLine = i != listData.Count - 1 || j != listData[i].listMsg.Count - 1;
this.AddMsgRowControl(framBack, listData[i], j, addLine);
}
}
//调整高度
listView.AdjustChidrenFrameHeight(framBack, Application.GetRealHeight(23));
if (countIndex == maxCount)
{
//调整桌布
listView.AdjustTableHeight();
//关闭刷新特效
listView.EndHeaderRefreshing();
//关闭进度条
this.CloseProgressBar();
}
});
//第一次的时候,等待的时候久一点
System.Threading.Thread.Sleep(waiTime);
waiTime = 300;
}
}
}
#endregion
#region ■ 右上角菜单_________________________
///
/// 初始化右上角菜单
///
private void InitTopRightMenu()
{
var btnIcon = new MostRightIconControl(69, 69);
btnIcon.UnSelectedImagePath = "Item/More.png";
topFrameLayout.AddChidren(btnIcon);
btnIcon.InitControl();
btnIcon.ButtonClickEvent += ((sender, e) =>
{
//显示底部菜单界面
this.ShowBottomMenu();
});
}
///
/// 显示底部菜单界面
///
private void ShowBottomMenu()
{
bool authority = UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2;
var menuContr = new BottomMenuSelectForm();
menuContr.AddForm(authority == true ? 2 : 1);
//全部已读
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uAllRead), () =>
{
//设置全部为已读
this.SetAllTickIsRead();
});
if (authority == true)
{
//全部删除
menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uAllDelete), () =>
{
//删除全部的消息
this.DeleteAllMsg();
});
}
}
#endregion
#region ■ 添加信息行_________________________
///
/// 添加信息行
///
///
///
/// 报警消息的下标
///
private void AddMsgRowControl(FrameListControl frameList, MessageRecordInfo recordInfo, int msgIndex, bool addLine)
{
var rowControl = new RowLayoutControl(frameList.rowSpace / 2);
frameList.AddChidren(rowControl);
rowControl.Name = frameList.ChildrenCount.ToString();
rowControl.MainKeys = recordInfo.Id;
this.dicAllRow[frameList.Name + "-" + rowControl.Name] = rowControl;
//图标
var btnIcon = rowControl.frameTable.AddLeftIcon(81);
btnIcon.UnSelectedImagePath = recordInfo.IconPath;
//消息类型
var btnMsgObject = rowControl.frameTable.AddLeftCaption(recordInfo.MsgObjectText, 600);
//消息
var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.listMsg[msgIndex], 600, 60);
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
btnMsg.Y = Application.GetRealHeight(5) + rowControl.frameTable.chidrenYaxis;
rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEvent);
//时间
var btnTime = rowControl.frameTable.AddMostRightView("", 200, 50);
btnTime.TextColor = UserCenterColor.Current.TextGrayColor1;
btnTime.Y = btnMsg.Bottom + Application.GetRealHeight(12);
var convertTime = UserCenterLogic.ConvertUtcTimeToLocalTime(recordInfo.CreatedOnUtc);
btnTime.Text = convertTime.ToString("HH:mm");
rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEvent);
//底线
if (addLine == true)
{
rowControl.frameTable.AddBottomLine();
}
//已读
if (recordInfo.ListReading[msgIndex] == true)
{
rowControl.frameTable.UseClickStatu = false;
//消息类型
btnMsgObject.TextColor = UserCenterColor.Current.TextGrayColor1;
//消息
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
}
//调整宽度
btnMsgObject.Width = btnMsgObject.GetRealWidthByText();
//新消息
PicViewControl btnNewTip = null;
if (recordInfo.ListReading[msgIndex] == false)
{
btnNewTip = new PicViewControl(78, 55);
btnNewTip.UnSelectedImagePath = "Item/NewVersion.png";
btnNewTip.Y = Application.GetRealHeight(9) + rowControl.frameTable.chidrenYaxis;
btnNewTip.X = btnMsgObject.Right + Application.GetRealWidth(10);
rowControl.frameTable.AddChidren(btnNewTip, ChidrenBindMode.BindEvent);
}
//主要主人和管理员能够删除
if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
{
//删除
var btnDelete = rowControl.AddDeleteControl();
btnDelete.ButtonClickEvent += (sender, e) =>
{
//确认删除消息?
string msg = Language.StringByID(R.MyInternationalizationString.uDeleteMessageMsg);
this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
this.DeleteMsg(recordInfo.Id, frameList, rowControl);
});
};
}
//点击
rowControl.frameTable.ButtonClickEvent += async (sender, e) =>
{
if (recordInfo.ListReading[msgIndex] == true)
{
return;
}
recordInfo.ListReading[msgIndex] = true;
rowControl.frameTable.UseClickStatu = false;
//消息类型
btnMsgObject.TextColor = UserCenterColor.Current.TextGrayColor1;
//消息
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor1;
btnNewTip.RemoveFromParent();
if (sender != null)
{
//标记已读(不管它成功不成功)
this.SetTickIsRead(recordInfo.Id);
}
};
}
#endregion
#region ■ 标记已读___________________________
///
/// 标记已读
///
///
private bool SetTickIsRead(string strId)
{
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.Id = strId;
var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagMessageMessageCenterItem", true, pra);
return result;
}
///
/// 设置全部为已读
///
private void SetAllTickIsRead()
{
if (dicAllRow.Count == 0)
{
return;
}
//确认标记全部消息为已读?
this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uUnTipAllMessageMsg), () =>
{
HdlThreadLogic.Current.RunThread(() =>
{
//打开进度条
this.ShowProgressBar();
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.TagAllOrClearType = 0;
var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
//关闭进度条
this.CloseProgressBar();
if (result == false)
{
return;
}
HdlThreadLogic.Current.RunMain(() =>
{
//设置全部状态
foreach (var contr in this.dicAllRow.Values)
{
contr.frameTable.ButtonClickEvent?.Invoke(null, null);
}
});
});
});
}
#endregion
#region ■ 删除信息___________________________
///
/// 删除信息
///
///
///
///
private bool DeleteMsg(string strId, FrameListControl frameList, RowLayoutControl rowContr)
{
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.Id = strId;
var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra);
if (result == false)
{
return false;
}
//云端是不会返回东西的
if (frameList != null)
{
HdlThreadLogic.Current.RunMain(() =>
{
//移除缓存
this.dicAllRow.Remove(frameList.Name + "-" + rowContr.Name);
//调整控件位置
this.AdjustControlLocation(frameList, rowContr);
});
}
return true;
}
///
/// 删除全部的消息
///
private void DeleteAllMsg()
{
if (dicAllRow.Count == 0)
{
return;
}
//确认删除全部消息?
this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteAllMessageMsg), () =>
{
HdlThreadLogic.Current.RunThread(() =>
{
//打开进度条
this.ShowProgressBar();
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.TagAllOrClearType = 1;
var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
if (result == false)
{
//关闭进度条
this.CloseProgressBar();
return;
}
//初始化中部信息
this.InitMiddleData(true);
});
});
}
#endregion
#region ■ 调整控件位置_______________________
///
/// 调整控件位置
///
///
private void AdjustControlLocation(FrameListControl frameList, RowLayoutControl removeRow)
{
int changedHeight = frameList.GetChildren(frameList.ChildrenCount - 1).Height;
if (frameList.ChildrenCount <= 2)
{
//已经删完了,只剩下标题日期了
changedHeight = frameList.Height;
}
//先调整各自容器的Y轴坐标
bool canChangedLoaction = false;
for (int i = 0; i < this.listView.frameTable.ChildrenCount; i++)
{
var myView = this.listView.frameTable.GetChildren(i);
if (myView.Name == frameList.Name)
{
//它之后的控件全部往上移动
canChangedLoaction = true;
continue;
}
if (canChangedLoaction == true)
{
myView.Y -= changedHeight;
}
}
//调整父容器大小
this.listView.AdjustTableHeight();
if (frameList.ChildrenCount <= 2)
{
//已经删完了,只剩下标题日期了
frameList.RemoveFromParent();
}
else
{
//这个容器里面被移除的行的下面的全部行,往上移动
bool changedFlage = false;
for (int i = 0; i < frameList.ChildrenCount; i++)
{
var myView = frameList.GetChildren(i);
if (myView.Name == removeRow.Name)
{
//它之后的控件全部往上移动
changedFlage = true;
continue;
}
if (changedFlage == true)
{
myView.Y -= changedHeight;
}
}
//移除指定的行
removeRow.RemoveFromParent();
//容器大小减少
frameList.Height -= changedHeight;
}
}
#endregion
#region ■ 获取数据___________________________
///
/// 获取消息记录
///
///
private Dictionary>> GetMessageData()
{
this.dicAllRow = new Dictionary();
var allListData = new List();
var pra = new MessageInfoPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
//传感器上报
pra.Topic = "/IASInfoReport";
var dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//门锁上报
pra.Topic = "/Alarms/SendAlarmInform";
dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//撤防
pra.Topic = "/Security/WithdrawMode_Respon";
dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//布防
pra.Topic = "/Security/EnableMode_Respon";
dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//逻辑触发上报
pra.Topic = "/Logic/Execute_Respon";
dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//场景触发上报
pra.Topic = "/Scene/Exec_Respon";
dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
}
allListData.AddRange(dataInfo);
//合并数据
return this.MergeMessageRecordData(allListData);
}
///
/// 从云端获取数据
///
///
///
private List GetMessageDataFromDb(MessageInfoPra pra)
{
var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra);
if (string.IsNullOrEmpty(result) == true)
{
return null;
}
var dataInfo = Newtonsoft.Json.JsonConvert.DeserializeObject(result);
var listData = new List();
for (int i = 0; i < dataInfo.PageData.Count; i++)
{
try
{
var data = dataInfo.PageData[i];
//处理消息类型
this.AdjustMsgContent(ref data);
listData.Add(data);
}
catch { continue; }
}
return listData;
}
///
/// 合并数据(同一天之内,会分组)
///
///
///
private Dictionary>> MergeMessageRecordData(List dataInfo)
{
var dicData = new Dictionary>>();
//首先先排序一下,时间大的放在前面
var dicTemp = new Dictionary>();
var listSortKeys = new List();
foreach (var data in dataInfo)
{
if (dicTemp.ContainsKey(data.CreatedOnUtc) == false)
{
dicTemp[data.CreatedOnUtc] = new List();
listSortKeys.Add(data.CreatedOnUtc);
}
dicTemp[data.CreatedOnUtc].Add(data);
}
listSortKeys.Sort();
var listGroup = new List();
for (int i = listSortKeys.Count - 1; i >= 0; i--)
{
var listData = dicTemp[listSortKeys[i]];
foreach (var data2 in listData)
{
if (data2.Topic == "/DoorLock/DoorLockOperatingEventNotificationCommand")
{
//暂时不处理这个主题
continue;
}
string[] myArry = data2.CreatedOnUtc.Split(new string[] { "T" }, StringSplitOptions.RemoveEmptyEntries);
if (myArry.Length != 2)
{
continue;
}
string dicKeys = myArry[0];//日期
if (dicData.ContainsKey(dicKeys) == false)
{
listGroup = new List();
dicData[dicKeys] = new List>();
dicData[dicKeys].Add(listGroup);
}
if (listGroup.Count > 20)
{
//每20个一组
listGroup = new List();
dicData[dicKeys].Add(listGroup);
}
listGroup.Add(data2);
}
}
return dicData;
}
#endregion
#region ■ 处理消息类型_______________________
///
/// 处理消息类型
///
/// 消息数据
private void AdjustMsgContent(ref MessageRecordInfo recordInfo)
{
var jobject = JObject.Parse(recordInfo.PayloadJson);
//传感器上报
if (recordInfo.Topic == "/IASInfoReport")
{
this.SensorDeviceReportPush(jobject, ref recordInfo);
}
//门锁上报
else if (recordInfo.Topic == "/Alarms/SendAlarmInform")
{
this.DoorLockDeviceReportPush(jobject, ref recordInfo);
}
//撤防
else if (recordInfo.Topic == "/Security/WithdrawMode_Respon")
{
this.RemoveSafetyGarrisonPush(jobject, ref recordInfo);
}
//布防
else if (recordInfo.Topic == "/Security/EnableMode_Respon")
{
this.SetSafetyGarrisonPush(jobject, ref recordInfo);
}
//逻辑触发上报
else if (recordInfo.Topic == "/Logic/Execute_Respon")
{
this.LogicExecutePush(jobject, ref recordInfo);
}
//场景触发上报
else if (recordInfo.Topic == "/Scene/Exec_Respon")
{
this.SceneExecPush(jobject, ref recordInfo);
}
}
#endregion
#region ■ 传感器上报_________________________
///
/// 传感器设备上报
///
///
private bool SensorDeviceReportPush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
var ias = new IASZone() { DeviceAddr = receiveData.Value("DeviceAddr"), DeviceEpoint = receiveData.Value("Epoint") };
ias.iASInfo = Newtonsoft.Json.JsonConvert.DeserializeObject(receiveData["Data"].ToString());
//图标
var localDevice = Common.LocalDevice.Current.GetDevice(ias.DeviceAddr, ias.DeviceEpoint);
if (localDevice == null)
{
recordInfo.IconPath = "Device/Sensor.png";
//消息类型:传感器
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId1200);
}
else
{
string selectPath = string.Empty;
string unselecPath = string.Empty;
Common.LocalDevice.Current.GetDeviceIcon(localDevice, ref unselecPath, ref selectPath);
recordInfo.IconPath = unselecPath;
//消息类型
recordInfo.MsgObjectText = Common.LocalDevice.Current.GetDeviceEpointName(localDevice);
}
//消息
var info = HdlAlarmsLogic.Current.GetSensorAlarmInfo(ias);
if (info == null)
{
//非在册的消息记录
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
return true;
}
if (string.IsNullOrEmpty(info.AlarmMsg) == false)
{
recordInfo.listMsg.Add(info.AlarmMsg);
}
if (info.BatteryMsg != null)
{
recordInfo.listMsg.Add(info.BatteryMsg);
}
if (info.DemolishmenMsg != null)
{
recordInfo.listMsg.Add(info.DemolishmenMsg);
}
//触发传感器报警
if (recordInfo.listMsg.Count == 0)
{
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
}
return true;
}
#endregion
#region ■ 门锁上报___________________________
///
/// 门锁上报
///
///
private void DoorLockDeviceReportPush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
//图标
var device = Common.LocalDevice.Current.GetDevice(receiveData.Value("DeviceAddr"), receiveData.Value("Epoint"));
if (device == null)
{
recordInfo.IconPath = "Device/IntelligentLocks.png";
//消息类型:智能门锁
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2800);
}
else
{
string selectPath = string.Empty;
string unselecPath = string.Empty;
Common.LocalDevice.Current.GetDeviceIcon(device, ref unselecPath, ref selectPath);
recordInfo.IconPath = unselecPath;
//消息类型
recordInfo.MsgObjectText = Common.LocalDevice.Current.GetDeviceEpointName(device);
}
//消息
var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(receiveData);
string MsgText = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
recordInfo.listMsg.Add(MsgText);
}
#endregion
#region ■ 布防_______________________________
///
/// 布防推送
///
///
private void SetSafetyGarrisonPush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
//图标
recordInfo.IconPath = "Item/Safety.png";
var data = Newtonsoft.Json.JsonConvert.DeserializeObject(receiveData["Data"].ToString());
if (data.Result == 0)
{
//离家布防
if (data.ModeId == 2)
{
//离家布防
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uRemoveHomeGarrison);
//已执行
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
else
{
//已执行
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
//没有内部防区
if (HdlSafeguardLogic.Current.IsHadInternalDefenseArea() == false)
{
//布防
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uGarrison);
}
else
{
//在家布防
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uAtHomeGarrison);
}
}
}
else
{
//布防设置失败
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uSetGarrisonFail);
}
}
#endregion
#region ■ 撤防_______________________________
///
/// 撤防推送
///
///
private void RemoveSafetyGarrisonPush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
//图标
recordInfo.IconPath = "Item/Safety.png";
var data = Newtonsoft.Json.JsonConvert.DeserializeObject(receiveData["Data"].ToString());
if (data.Result == 0)
{
//已执行
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
//撤防
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uWithdrawGarrison);
}
else
{
//撤防失败
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uRemoveGarrisonFail);
}
}
#endregion
#region ■ 逻辑触发上报_______________________
///
/// 逻辑触发上报
///
///
private void LogicExecutePush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
//图标
recordInfo.IconPath = "Item/LogicMsgIcon.png";
//类型:逻辑名字
recordInfo.MsgObjectText = receiveData["Data"]["LogicName"].ToString();
//已执行
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
#endregion
#region ■ 场景触发上报_______________________
///
/// 场景触发上报
///
///
private void SceneExecPush(JObject receiveData, ref MessageRecordInfo recordInfo)
{
//图标
recordInfo.IconPath = "Item/SceneMsgIcon.png";
//类型:场景名字
recordInfo.MsgObjectText = receiveData["Data"]["ScenesName"].ToString();
//已执行
recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
#endregion
#region ■ 界面关闭___________________________
///
/// 界面关闭
///
public override void CloseFormBefore()
{
var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
if (userPageForm != null && userPageForm.FormID == "UserMainForm")
{
Common.CommonPage.Instance.IsDrawerLockMode = false;
}
base.CloseFormBefore();
}
#endregion
}
}