public override void RemoveByKey(string key) { if (AllowRemoveInternal) base.RemoveByKey(key); else { if (ContainsKey(key)) throw new NotSupportedException("ReadOnly controls collection"); } }