implementation of [OqtaneIgnore] class attribute in controls

This commit is contained in:
Pavel Vesely
2020-05-07 18:51:55 +02:00
parent 6586883979
commit 47f17a589f
31 changed files with 227 additions and 178 deletions

View File

@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Oqtane.Shared;
// ReSharper disable once CheckNamespace
namespace System.Reflection
@ -31,5 +33,20 @@ namespace System.Reflection
return assembly.GetTypes()
.Where(t => t.GetInterfaces().Contains(interfaceType));
}
public static bool IsOqtaneAssembly(this Assembly assembly)
{
return assembly.FullName != null && (assembly.FullName.Contains("oqtane.", StringComparison.OrdinalIgnoreCase));
}
public static bool IsOqtaneAssembly(this FileInfo fileInfo)
{
return (fileInfo.Name.Contains("oqtane.", StringComparison.OrdinalIgnoreCase));
}
public static IEnumerable<Assembly> GetOqtaneAssemblies(this AppDomain appDomain)
{
return appDomain.GetAssemblies().Where(a => a.IsOqtaneAssembly());
}
}
}