/// <summary> /// Removes the given key from the Ini. (if it exists) /// </summary> /// <param name="key">The key</param> public void RemoveKey(string key) { lock (KeyValuePairs) if (KeyValuePairs.ContainsKey(key)) { KeyValuePairs.Remove(key); } }
/// <summary> /// 移除 /// </summary> /// <param name="key"></param> public void Remove(Key key) { if (!KeyValuePairs.ContainsKey(key)) { return; } var value = KeyValuePairs[key]; KeyValuePairs.Remove(key); ValueKeyPairs.Remove(value); }
public bool Remove(string key) { if (json.Type == JTokenType.Null) { return(false); } var jsonObject = (JObject)json; bool removed = jsonObject.Remove(key); if (!removed) { return(false); } KeyValuePairs.Remove(key); return(true); }