diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetRenderer.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetRenderer.cs new file mode 100644 index 0000000000..5ef4abadba --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetRenderer.cs @@ -0,0 +1,18 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets +{ + public interface IWidgetRenderer : ITransientDependency + { + Task RenderAsync(string mywidget); + } + + public class WidgetRenderer : IWidgetRenderer + { + public Task RenderAsync(string mywidget) + { + throw new System.NotImplementedException(); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs new file mode 100644 index 0000000000..d164e3a50c --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs @@ -0,0 +1,38 @@ +using System; +using JetBrains.Annotations; +using Volo.Abp.Localization; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets +{ + public class WidgetDefinition + { + /// + /// Unique name of the widget. + /// + [NotNull] + public string Name { get; } + + /// + /// Display name of the widget. + /// + [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); + } + } +} diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetOptions.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetOptions.cs new file mode 100644 index 0000000000..7a4fa3487f --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetOptions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Volo.Abp.AspNetCore.Mvc.UI.Widgets +{ + public class WidgetOptions + { + public List Widgets { get; } + + public WidgetOptions() + { + Widgets = new List(); + } + } +}