private void AddPropertyEditor(Control container, ContentItem item, PropertyInfo propertyInfo) { // Add a label. string displayName = propertyInfo.Name; var attributes = (ContentAttribute[])propertyInfo.GetCustomAttributes(typeof(ContentAttribute), true); if (attributes != null && attributes.Length > 0) { displayName = attributes[0].DisplayName; } Label label = CreateLabel(displayName); // Create an appropriate property editor. IContentEditor editor = GetContentEditor(item, propertyInfo.Name); _propertyEditors.Add(editor); Control panel = CreatePanel(); editor.AddControls(panel); // Add teh combination. AddProperty(container, label, panel); }
private void CreateEditor() { _editor = CreateContentEditor(_item); if (_editor != null) { Controls.Clear(); _editor.AddControls(this); } }
private void AddPropertyEditor(Control container, ContentItem item, PropertyInfo propertyInfo, string displayName) { // Add a label. Label label = CreateLabel(displayName); // Create an appropriate property editor. IContentEditor editor = GetContentEditor(item, propertyInfo); _propertyEditors.Add(editor); Control panel = CreatePanel(); editor.AddControls(panel); // Add the combination. AddProperty(container, label, panel); }