/// <summary> /// 添加一个hostjs对象 /// </summary> /// <param name="obj"></param> public void AddHostJsObject(BaseHostJsObject obj) { if (!_hostobject.ContainsKey(obj.Name)) { _hostobject.Add(obj.Name, obj); } }
/// <summary> /// 添加一个对象,有则更新,没有则新增 /// </summary> /// <param name="obj"></param> public void SetHostJsObject(BaseHostJsObject obj) { if (!_hostobject.ContainsKey(obj.Name)) { _hostobject.Add(obj.Name, obj); } else { _hostobject.Remove(obj.Name); _hostobject.Add(obj.Name, obj); } }