Merge pull request #574 from chlupac/OqtaneIgnore
OqtaneIgnore implementation fix
This commit is contained in:
@ -6,7 +6,7 @@ using Oqtane.UI;
|
|||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
public class ContainerBase : ComponentBase, IContainerControl
|
public abstract class ContainerBase : ComponentBase, IContainerControl
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
protected IJSRuntime JSRuntime { get; set; }
|
protected IJSRuntime JSRuntime { get; set; }
|
||||||
|
@ -4,7 +4,7 @@ using Oqtane.UI;
|
|||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
public class LayoutBase : ComponentBase, ILayoutControl
|
public abstract class LayoutBase : ComponentBase, ILayoutControl
|
||||||
{
|
{
|
||||||
[CascadingParameter]
|
[CascadingParameter]
|
||||||
protected PageState PageState { get; set; }
|
protected PageState PageState { get; set; }
|
||||||
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
public class ThemeBase : ComponentBase, IThemeControl
|
public abstract class ThemeBase : ComponentBase, IThemeControl
|
||||||
{
|
{
|
||||||
[Inject]
|
[Inject]
|
||||||
protected IJSRuntime JSRuntime { get; set; }
|
protected IJSRuntime JSRuntime { get; set; }
|
||||||
|
@ -4,7 +4,7 @@ using Oqtane.UI;
|
|||||||
|
|
||||||
namespace Oqtane.Themes
|
namespace Oqtane.Themes
|
||||||
{
|
{
|
||||||
public class ThemeControlBase : ComponentBase
|
public abstract class ThemeControlBase : ComponentBase
|
||||||
{
|
{
|
||||||
[CascadingParameter]
|
[CascadingParameter]
|
||||||
protected PageState PageState { get; set; }
|
protected PageState PageState { get; set; }
|
||||||
|
@ -193,11 +193,7 @@ namespace Oqtane.Repository
|
|||||||
foreach (Type modulecontroltype in modulecontroltypes)
|
foreach (Type modulecontroltype in modulecontroltypes)
|
||||||
{
|
{
|
||||||
// Check if type should be ignored
|
// Check if type should be ignored
|
||||||
if (modulecontroltype.Name == "ModuleBase"
|
if (modulecontroltype.IsOqtaneIgnore()) continue;
|
||||||
|| modulecontroltype.IsGenericType
|
|
||||||
|| modulecontroltype.IsAbstract
|
|
||||||
|| modulecontroltype.IsOqtaneIgnore()
|
|
||||||
) continue;
|
|
||||||
|
|
||||||
// create namespace root typename
|
// create namespace root typename
|
||||||
string qualifiedModuleType = modulecontroltype.Namespace + ", " + modulecontroltype.Assembly.GetName().Name;
|
string qualifiedModuleType = modulecontroltype.Namespace + ", " + modulecontroltype.Assembly.GetName().Name;
|
||||||
|
@ -50,10 +50,7 @@ namespace Oqtane.Repository
|
|||||||
foreach (Type themeControlType in themeControlTypes)
|
foreach (Type themeControlType in themeControlTypes)
|
||||||
{
|
{
|
||||||
// Check if type should be ignored
|
// Check if type should be ignored
|
||||||
if (themeControlType.Name == "ThemeBase"
|
if (themeControlType.IsOqtaneIgnore()
|
||||||
|| themeControlType.IsGenericType
|
|
||||||
|| themeControlType.IsAbstract
|
|
||||||
|| themeControlType.IsOqtaneIgnore()
|
|
||||||
) continue;
|
) continue;
|
||||||
|
|
||||||
// create namespace root typename
|
// create namespace root typename
|
||||||
|
@ -80,9 +80,14 @@ namespace System.Reflection
|
|||||||
.Where(a => Utilities.GetFullTypeName(a.GetName().Name) != "Oqtane.Client");
|
.Where(a => Utilities.GetFullTypeName(a.GetName().Name) != "Oqtane.Client");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if type should be ignored by oqtane dynamic loader
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">Checked type</param>
|
||||||
|
/// <returns></returns>
|
||||||
public static bool IsOqtaneIgnore(this Type type)
|
public static bool IsOqtaneIgnore(this Type type)
|
||||||
{
|
{
|
||||||
return Attribute.IsDefined(type, typeof(OqtaneIgnoreAttribute));
|
return Attribute.IsDefined(type, typeof(OqtaneIgnoreAttribute)) || type.IsAbstract || type.IsGenericType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user