public MudTrait Add(string name, string val) { if (Has(name)) { return(null); } var trait = new MudTrait(name, val); _traits.Add(trait); //TODO: listeners notify that trait was added return(trait); }
public MudTrait Set(string name, string val) { var trait = _traits.SingleOrDefault(x => x.Name == name); if (trait != null) { trait.Value = val; } else { trait = new MudTrait(name, val); } return(trait); }