30 lines
788 B
C#
30 lines
788 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.Extensions.Localization;
|
|
using WalkingTec.Mvvm.Core;
|
|
|
|
namespace WalkingTec.Mvvm.Mvc
|
|
{
|
|
public static class ActionDescriptionExtension
|
|
{
|
|
public static string GetDescription(this ActionDescriptionAttribute self, IBaseController controller)
|
|
{
|
|
return self.GetDescription(controller.GetType());
|
|
}
|
|
|
|
public static string GetDescription(this ActionDescriptionAttribute self, Type controllertype)
|
|
{
|
|
string rv = "";
|
|
if (string.IsNullOrEmpty(self.Description) == false)
|
|
{
|
|
rv = Core.CoreProgram._localizer?[self.Description];
|
|
}
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
|
}
|