Esempio n. 1
0
 /// <summary>
 /// Configure the builder by default from attributes.
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static IRazorComponentClientModuleManifestBuilder WithDefaultsFromModuleType(this IRazorComponentClientModuleManifestBuilder builder, Type type)
 {
     {
         var attrs = type.GetCustomAttributes <ModuleUIResourceAttribute>();
         foreach (var attr in attrs)
         {
             builder.WithResource(new UIResource(attr.Type, attr.Path)
             {
                 Attributes = attr.Attributes
             });
         }
     }
     {
         var attrs = type.GetCustomAttributes <ModuleUIGlobalComponentAttribute>();
         foreach (var attr in attrs)
         {
             builder.WithGlobalComponent(attr.Type);
         }
     }
     {
         var attr = type.GetCustomAttribute <ModulePageProviderAttribute>();
         if (attr is not null)
         {
             builder.WithPageProvider(attr.Type);
         }
     }
     return(builder);
 }
 public override void ConfigureRazorComponentClientModuleManifest(IRazorComponentClientModuleManifestBuilder builder)
 {
     switch (Option.Provider)
     {
     case MaterialDesignIconProvider.Font:
         builder.WithResource(new UIResource(UIResourceType.StyleSheet, "_content/StardustDL.RazorComponents.MaterialDesignIcons/mdi/font/css/materialdesignicons.min.css"));
         break;
     }
     base.ConfigureRazorComponentClientModuleManifest(builder);
 }