Browse Source

Added widget renderer

pull/1140/head
Halil ibrahim Kalkan 7 years ago
parent
commit
4d79878f7e
  1. 18
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/IWidgetRenderer.cs
  2. 38
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetDefinition.cs
  3. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Widgets/Volo/Abp/AspNetCore/Mvc/UI/Widgets/WidgetOptions.cs

18
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<object> RenderAsync(string mywidget);
}
public class WidgetRenderer : IWidgetRenderer
{
public Task<object> RenderAsync(string mywidget)
{
throw new System.NotImplementedException();
}
}
}

38
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
{
/// <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);
}
}
}

14
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<WidgetDefinition> Widgets { get; }
public WidgetOptions()
{
Widgets = new List<WidgetDefinition>();
}
}
}
Loading…
Cancel
Save