mirror of https://github.com/abpframework/abp.git
3 changed files with 70 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
||||
|
{ |
||||
|
public interface IWidgetRenderer : ITransientDependency |
||||
|
{ |
||||
|
Task<object> RenderAsync(string mywidget); |
||||
|
} |
||||
|
|
||||
|
public class WidgetRenderer : IWidgetRenderer |
||||
|
{ |
||||
|
public Task<object> RenderAsync(string mywidget) |
||||
|
{ |
||||
|
throw new System.NotImplementedException(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
using System; |
||||
|
using JetBrains.Annotations; |
||||
|
using Volo.Abp.Localization; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
||||
|
{ |
||||
|
public class WidgetDefinition |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Unique name of the widget.
|
||||
|
/// </summary>
|
||||
|
[NotNull] |
||||
|
public string Name { get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Display name of the widget.
|
||||
|
/// </summary>
|
||||
|
[NotNull] |
||||
|
public ILocalizableString DisplayName |
||||
|
{ |
||||
|
get => _displayName; |
||||
|
set => _displayName = Check.NotNull(value, nameof(value)); |
||||
|
} |
||||
|
private ILocalizableString _displayName; |
||||
|
|
||||
|
public Type ViewComponentType { get; set; } |
||||
|
|
||||
|
public WidgetDefinition( |
||||
|
[NotNull] string name, |
||||
|
[NotNull] Type viewComponentType, |
||||
|
[CanBeNull] ILocalizableString displayName) |
||||
|
{ |
||||
|
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
||||
|
ViewComponentType = Check.NotNull(viewComponentType, nameof(viewComponentType)); |
||||
|
DisplayName = displayName ?? new FixedLocalizableString(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets |
||||
|
{ |
||||
|
public class WidgetOptions |
||||
|
{ |
||||
|
public List<WidgetDefinition> Widgets { get; } |
||||
|
|
||||
|
public WidgetOptions() |
||||
|
{ |
||||
|
Widgets = new List<WidgetDefinition>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue