public static HomePageMessageManage Manage() { if (_manage == null) { _manage = new HomePageMessageManage(); } return(_manage); }
/// <summary> /// 获取所需状态的电脑数组 /// </summary> /// <param name="tem">接收数组</param> /// <param name="status">状态</param> public static void GetStatusComputers(out List <StructRealTime> tem, COMPUTERSTATUS status) { tem = new List <StructRealTime>(); if (HomePageMessageManage.Manage().computers != null) { IEnumerable <StructRealTime> statusComs = from StructRealTime com in Manage().computers where com.Status.Equals(((int)status).ToString()) select com; tem = statusComs.ToList <StructRealTime>(); } }
private void UpdateHomePage(int index, StructRealTime newcom) { //如果当前在过滤条件下以及电脑状态也在过滤条件下则重新搜索过滤数据 if (IsFilter && this.s_status != COMPUTERSTATUS.无) { //判断是否影响当前搜索 HomePageMessageManage.GetFilterComputers(this.s_status, this.s_areaId, this.s_key); } //否则更新单个电脑状态 else { if (this.UpdateComputerDataEvent != null) { this.UpdateComputerDataEvent(newcom); } } }
private int GetComputerIndex(int comid) { return(HomePageMessageManage.GetComputerIndex(comid, Manage().computers)); }