public ElementCreationOptionModel(IElement element, string requiredType = SpecializationType)
        {
            if (element.SpecializationType != SpecializationType)
            {
                throw new ArgumentException($"Invalid element [{element}]");
            }

            _element = element;

            //Text = element.Name;
            //Shortcut = element.TypeReference.Element.GetStereotypeProperty<string>("Default Creation Options", "Shortcut");
            //DefaultName = this.GetOptionSettings().DefaultName() ?? $"New{element.TypeReference.Element.Name.ToCSharpIdentifier()}";
            Icon = element.TypeReference.Element.GetStereotypeProperty <IIconModel>("Settings", "Icon");
            Type = new ElementSettingsModel((IElement)TypeReference.Element);
            //AllowMultiple = element.GetStereotypeProperty("Creation Options", "Allow Multiple", true);
        }
 public static bool HasTypeReferenceSettings(this ElementSettingsModel model)
 {
     return(model.HasStereotype("Type Reference Settings"));
 }
        public static TypeReferenceSettings GetTypeReferenceSettings(this ElementSettingsModel model)
        {
            var stereotype = model.GetStereotype("Type Reference Settings");

            return(stereotype != null ? new TypeReferenceSettings(stereotype) : null);
        }
        public static Settings GetSettings(this ElementSettingsModel model)
        {
            var stereotype = model.GetStereotype("Settings");

            return(stereotype != null ? new Settings(stereotype) : null);
        }
Exemplo n.º 5
0
 public bool Equals(ElementSettingsModel other)
 {
     return(Equals(_element, other?._element));
 }