コード例 #1
0
        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));
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 public static bool IsSQLServerDatabaseProjectModel(this ICanBeReferencedType type)
 {
     return(type != null && type is IElement element && element.SpecializationTypeId == SQLServerDatabaseProjectModel.SpecializationTypeId);
 }
コード例 #4
0
 public static bool IsRoleModel(this ICanBeReferencedType type)
 {
     return(type != null && type is IElement element && element.SpecializationTypeId == RoleModel.SpecializationTypeId);
 }
コード例 #5
0
 public static RoleModel AsRoleModel(this ICanBeReferencedType type)
 {
     return(type.IsRoleModel() ? new RoleModel((IElement)type) : null);
 }
コード例 #6
0
 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);
 }
コード例 #8
0
 public static bool IsConsoleAppNETFrameworkModel(this ICanBeReferencedType type)
 {
     return(type != null && type is IElement element && element.SpecializationTypeId == ConsoleAppNETFrameworkModel.SpecializationTypeId);
 }
コード例 #9
0
 public static AzureFunctionsProjectModel AsAzureFunctionsProjectModel(this ICanBeReferencedType type)
 {
     return(type.IsAzureFunctionsProjectModel() ? new AzureFunctionsProjectModel((IElement)type) : null);
 }
コード例 #10
0
 public static RuntimeEnvironmentModel AsRuntimeEnvironmentModel(this ICanBeReferencedType type)
 {
     return(type.IsRuntimeEnvironmentModel() ? new RuntimeEnvironmentModel((IElement)type) : null);
 }
コード例 #11
0
 public static FolderModel AsFolderModel(this ICanBeReferencedType type)
 {
     return(type.IsFolderModel() ? new FolderModel((IElement)type) : null);
 }
コード例 #12
0
 public ElementTypeReference(ICanBeReferencedType element, bool isNullable = false, bool isCollection = false)
 {
     Element      = element;
     IsNullable   = isNullable;
     IsCollection = isCollection;
 }
コード例 #13
0
 /// <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);
 }
コード例 #15
0
 public static SQLServerDatabaseProjectModel AsSQLServerDatabaseProjectModel(this ICanBeReferencedType type)
 {
     return(type.IsSQLServerDatabaseProjectModel() ? new SQLServerDatabaseProjectModel((IElement)type) : null);
 }
コード例 #16
0
 public static bool IsAzureFunctionsProjectModel(this ICanBeReferencedType type)
 {
     return(type != null && type is IElement element && element.SpecializationTypeId == AzureFunctionsProjectModel.SpecializationTypeId);
 }
コード例 #17
0
 public static NETCoreVersionModel AsNETCoreVersionModel(this ICanBeReferencedType type)
 {
     return(type.IsNETCoreVersionModel() ? new NETCoreVersionModel((IElement)type) : null);
 }
コード例 #18
0
 public static bool IsClassLibraryNETCoreModel(this ICanBeReferencedType type)
 {
     return(type != null && type is IElement element && element.SpecializationTypeId == ClassLibraryNETCoreModel.SpecializationTypeId);
 }
コード例 #19
0
 public static ClassLibraryNETFrameworkModel AsClassLibraryNETFrameworkModel(this ICanBeReferencedType type)
 {
     return(type.IsClassLibraryNETFrameworkModel() ? new ClassLibraryNETFrameworkModel((IElement)type) : null);
 }
コード例 #20
0
 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);
 }