public LayoutPartDescription(LayoutPartDescriptionGroup group, Guid uid, int index, string name, string description, string iconName = null, bool allowMultiple = true, LayoutPartSize size = null, IEnumerable<LayoutPartProperty> properties = null) { Group = group; UID = uid; Index = index; Name = name; Description = description; if (!string.IsNullOrEmpty(iconName)) IconSource = IconPath + iconName; AllowMultiple = allowMultiple; Size = size ?? new LayoutPartSize() { PreferedSize = new Size(100, 100) }; var list = new List<LayoutPartProperty>() { new LayoutPartProperty(LayoutPartPropertyAccess.GetOrSet, typeof(string), LayoutPartPropertyName.Title), new LayoutPartProperty(LayoutPartPropertyAccess.GetOrSet, typeof(int), LayoutPartPropertyName.Margin), new LayoutPartProperty(LayoutPartPropertyAccess.GetOrSet, typeof(Color), LayoutPartPropertyName.BackgroundColor), new LayoutPartProperty(LayoutPartPropertyAccess.GetOrSet, typeof(Color), LayoutPartPropertyName.BorderColor), new LayoutPartProperty(LayoutPartPropertyAccess.GetOrSet, typeof(int), LayoutPartPropertyName.BorderThickness), }; if (properties != null) list.AddRange(properties); Properties = list; }
public LayoutPartDescription(LayoutPartDescriptionGroup group, Guid uid, int index, string name, string description, string iconName = null, params LayoutPartProperty[] properties) : this(group, uid, index, name, description, iconName, true, null, properties) { }