public StereotypeDefinitionCreationOptionModel(IElement element, string requiredType = SpecializationType) { if (!requiredType.Equals(element.SpecializationType, StringComparison.InvariantCultureIgnoreCase)) { throw new Exception($"Cannot create a '{GetType().Name}' from element with specialization type '{element.SpecializationType}'. Must be of type '{SpecializationType}'"); } _element = element; Icon = element.TypeReference.Element.GetStereotypeProperty <IIconModel>("Settings", "Icon"); Type = new CoreTypeModel((IElement)TypeReference.Element); }
public bool Equals(CoreTypeModel other) { return(Equals(_element, other?._element)); }
public static bool HasSettings(this CoreTypeModel model) { return(model.HasStereotype("Settings")); }
public static Settings GetSettings(this CoreTypeModel model) { var stereotype = model.GetStereotype("Settings"); return(stereotype != null ? new Settings(stereotype) : null); }