示例#1
0
 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));
 }
示例#3
0
 public static bool HasSettings(this CoreTypeModel model)
 {
     return(model.HasStereotype("Settings"));
 }
示例#4
0
        public static Settings GetSettings(this CoreTypeModel model)
        {
            var stereotype = model.GetStereotype("Settings");

            return(stereotype != null ? new Settings(stereotype) : null);
        }