void _AddAgent(CKey Key_, SAgent Agent_, SProc Proc_) { var Agent = _AddAgent(Key_, Agent_); if (Agent == null) { throw new Exception("AddAgent Fail"); } _SetProc(Agent, Proc_); }
_CAgentInfo _AddAgent(CKey Key_, SAgent Agent_) { if (_AgentInfos.ContainsKey(Key_.PeerNum)) { return(null); } var Agent = _AgentInfos[Key_.PeerNum] = new _CAgentInfo(Key_, _AddItem(Key_.PeerNum.ToString("D5")), Agent_.Option, (JsonDataObject)JsonParser.Parse(Agent_.Stat), null); Agent.Item.SubItems[(Int32)EField.AgentName].Text = Agent_.Name; Agent.Item.SubItems[(Int32)EField.AgentOption].Text = Agent_.Option.ToJsonString(); Agent.Item.SubItems[(Int32)EField.AgentStat].Text = Agent_.Stat; Agent.Item.UseItemStyleForSubItems = false; return(Agent); }