public void Release(string uid) { foreach (LockEffect effect in Effects.OfType <LockEffect>().Where(effect => effect.Uid == uid)) { effect.Alive = false; } if (!(Effects.OfType <LockEffect>().Any())) { Released.SafeInvoke(null, EventArgs.Empty); } }
public void Release(bool force) { //Release all lock effects foreach (LockEffect effect in Effects.OfType <LockEffect>()) { if (!force && !String.IsNullOrEmpty(effect.Uid)) { continue; } effect.Alive = false; } Released.SafeInvoke(null, EventArgs.Empty); }