/// <summary> /// 移除PurchaseResult /// </summary> public void RemovePurchaseResult(PurchaseResult result) { if (HasPurchaseResult()) { _keys.Remove(result); _keyDirty = true; } }
void AddKey(PurchaseResult item) { if (_keys == null) { LoadKeys(); } if (_keys != null) { _keys.Add(item); _keyDirty = true; } }
/// <summary> /// 获得第一个PurchaseResult /// </summary> /// <param name="remove">是否移除记录</param> public PurchaseResult GetFristPurchaseResult(bool remove) { PurchaseResult res = null; if (HasPurchaseResult()) { res = _keys [0]; if (remove) { RemovePurchaseResult(res); } } return(res); }
/// <summary> /// 获得第一个PurchaseResult /// </summary> /// <param name="remove">是否移除记录</param> public PurchaseResult GetFristPurchaseResult(string key, int code, bool remove) { PurchaseResult res = null; if (HasPurchaseResult()) { for (int i = 0; i < _keys.Count; i++) { if (_keys[i].iapKey.CompareTo(key) == 0 && _keys[i].code == code) { res = _keys [i]; if (remove) { RemovePurchaseResult(res); } break; } } } return(res); }