public static DesignerSettingsModel GetDesignerSettings(ICanBeReferencedType forElement) { var designerElement = ((forElement as IElement) ?? ((IAssociationEnd)forElement).Association.SourceEnd.Element as IElement).GetParentPath() .Single(x => x.SpecializationType == Api.DesignerSettingsModel.SpecializationType || x.SpecializationType == Api.DesignerExtensionModel.SpecializationType); return(Create(designerElement)); }
public ModelerModelType(ICanBeReferencedType element) { if (element.SpecializationType != "Element Settings" && element.SpecializationType != "Package Settings" && element.SpecializationType != "Association Source End Settings" && element.SpecializationType != "Association Destination End Settings" && element.SpecializationType != "Element Extension" && element.SpecializationType != "Package Extension") { throw new InvalidOperationException($"Cannot load {nameof(ModelerModelType)} from element of type {element.SpecializationType}"); } _element = element; }
public static bool IsSQLServerDatabaseProjectModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == SQLServerDatabaseProjectModel.SpecializationTypeId); }
public static bool IsRoleModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == RoleModel.SpecializationTypeId); }
public static RoleModel AsRoleModel(this ICanBeReferencedType type) { return(type.IsRoleModel() ? new RoleModel((IElement)type) : null); }
public static TemplateOutputModel AsTemplateOutputModel(this ICanBeReferencedType type) { return(type.IsTemplateOutputModel() ? new TemplateOutputModel((IElement)type) : null); }
public static ASPNETCoreWebApplicationModel AsASPNETCoreWebApplicationModel(this ICanBeReferencedType type) { return(type.IsASPNETCoreWebApplicationModel() ? new ASPNETCoreWebApplicationModel((IElement)type) : null); }
public static bool IsConsoleAppNETFrameworkModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == ConsoleAppNETFrameworkModel.SpecializationTypeId); }
public static AzureFunctionsProjectModel AsAzureFunctionsProjectModel(this ICanBeReferencedType type) { return(type.IsAzureFunctionsProjectModel() ? new AzureFunctionsProjectModel((IElement)type) : null); }
public static RuntimeEnvironmentModel AsRuntimeEnvironmentModel(this ICanBeReferencedType type) { return(type.IsRuntimeEnvironmentModel() ? new RuntimeEnvironmentModel((IElement)type) : null); }
public static FolderModel AsFolderModel(this ICanBeReferencedType type) { return(type.IsFolderModel() ? new FolderModel((IElement)type) : null); }
public ElementTypeReference(ICanBeReferencedType element, bool isNullable = false, bool isCollection = false) { Element = element; IsNullable = isNullable; IsCollection = isCollection; }
/// <summary> /// Converts <see cref="ICanBeReferencedType"/> to type of <see cref="ITypeReference"/> /// </summary> /// <param name="type"></param> /// <returns></returns> public static ITypeReference AsTypeReference(this ICanBeReferencedType type) { return(new ElementTypeReference(type)); }
private bool IsComplexObject(ICanBeReferencedType element) { return(element.SpecializationTypeId != TypeDefinitionModel.SpecializationTypeId && element.SpecializationTypeId != EnumModel.SpecializationTypeId); }
public static SQLServerDatabaseProjectModel AsSQLServerDatabaseProjectModel(this ICanBeReferencedType type) { return(type.IsSQLServerDatabaseProjectModel() ? new SQLServerDatabaseProjectModel((IElement)type) : null); }
public static bool IsAzureFunctionsProjectModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == AzureFunctionsProjectModel.SpecializationTypeId); }
public static NETCoreVersionModel AsNETCoreVersionModel(this ICanBeReferencedType type) { return(type.IsNETCoreVersionModel() ? new NETCoreVersionModel((IElement)type) : null); }
public static bool IsClassLibraryNETCoreModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == ClassLibraryNETCoreModel.SpecializationTypeId); }
public static ClassLibraryNETFrameworkModel AsClassLibraryNETFrameworkModel(this ICanBeReferencedType type) { return(type.IsClassLibraryNETFrameworkModel() ? new ClassLibraryNETFrameworkModel((IElement)type) : null); }
public static ConsoleAppNETFrameworkModel AsConsoleAppNETFrameworkModel(this ICanBeReferencedType type) { return(type.IsConsoleAppNETFrameworkModel() ? new ConsoleAppNETFrameworkModel((IElement)type) : null); }
public static bool IsASPNETCoreWebApplicationModel(this ICanBeReferencedType type) { return(type != null && type is IElement element && element.SpecializationTypeId == ASPNETCoreWebApplicationModel.SpecializationTypeId); }