public ComponentView CreateComponentView(Container container, string key, string description) { AssertThatTheViewKeyIsUnique(key); ComponentView view = new ComponentView(container, key, description); ComponentViews.Add(view); return(view); }
public ComponentView CreateComponentView(Container container, string key, string description) { if (GetViewWithKey(key) != null) { throw new ArgumentException("A view with the key " + key + " already exists."); } else { ComponentView view = new ComponentView(container, key, description); ComponentViews.Add(view); return(view); } }