public UIComponent(UIComponentAttribute attribute, Type type) { this.Id = attribute.Id; this.Name = StringResourceReader.GetString(type, nameof(this.Name)) ?? type.Name; this.Description = StringResourceReader.GetString(type, nameof(this.Description)) ?? string.Empty; this.Role = attribute.Role; this.Type = type; }
public UIComponent(UIComponentAttribute attribute, Type type) { this.Id = attribute.Id; this.Name = attribute.Name; this.Description = attribute.Description; this.Role = attribute.Role; this.Type = type; }
private IEnumerable <UIComponent> GetComponents() { var components = new List <UIComponent>(); foreach (var type in ComponentScanner.Instance.GetComponents(typeof(IUIComponent))) { var attribute = default(UIComponentAttribute); if (!type.HasCustomAttribute <UIComponentAttribute>(false, out attribute)) { attribute = new UIComponentAttribute(type.AssemblyQualifiedName, UIComponentSlots.NONE, type.Name); } components.Add(new UIComponent(attribute, type)); } return(components); }