void 设置表格颜色(DataGridViewRow __行, EGPS状态 __状态) { var __样式 = __行.Cells[1].Style; switch (__状态) { case EGPS状态.最近更新: __样式.BackColor = Color.SkyBlue; break; case EGPS状态.短期未更新: __样式.BackColor = Color.Red; break; case EGPS状态.很久未更新: __样式.BackColor = Color.Gray; break; case EGPS状态.停止显示: __样式.BackColor = Color.Yellow; break; default: __样式.BackColor = Color.White; break; } }
void 数据交互_状态更新(string __标识, EGPS状态 __状态) { if (!_状态缓存.ContainsKey(__标识)) { return; } _状态缓存[__标识] = __状态; }
protected virtual Image 更新图片(string __标识, EGPS状态 __状态) { if (_图片缓存.ContainsKey(__状态)) { return(_图片缓存[__状态]); } return(null); }
protected virtual void On状态变化(string __标识, EGPS状态 __新状态) { var handler = 状态变化; if (handler != null) { handler(__标识, __新状态); } }
public MGPS 查询位置(string __标识, out EGPS状态 __EGPS状态) { _状态锁.EnterReadLock(); if (_所有状态.ContainsKey(__标识)) { var __位置 = _所有状态[__标识].最后位置; __EGPS状态 = _所有状态[__标识].跟踪状态; _状态锁.ExitReadLock(); return(__位置); } _状态锁.ExitReadLock(); __EGPS状态 = EGPS状态.从未有过; return(null); }
void GPS状态变化(string __号码, EGPS状态 __新状态) { _IV地图.UI线程执行(() => { if (_标识参数.ContainsKey(__号码)) { 更新状态(__号码); } var __temp = 状态更新; if (__temp != null) { __temp(__号码, __新状态); } }); }