mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Add a DynamicallyAccessedMembers attribute to AddPageFactory<TPage, TPageFactory>
This commit is contained in:
@@ -117,7 +117,11 @@
|
|||||||
pageFactoryCache.Add(type, pageFactory);
|
pageFactoryCache.Add(type, pageFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NET6_0_OR_GREATER
|
||||||
|
internal void AddPageFactory<TPage, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
||||||
|
#else
|
||||||
internal void AddPageFactory<TPage, TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
internal void AddPageFactory<TPage, TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
var constructor = typeof(TPageFactory).GetConstructor(new[]
|
var constructor = typeof(TPageFactory).GetConstructor(new[]
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -148,7 +148,11 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TPage"></typeparam>
|
/// <typeparam name="TPage"></typeparam>
|
||||||
/// <typeparam name="TPageFactory"></typeparam>
|
/// <typeparam name="TPageFactory"></typeparam>
|
||||||
|
#if NET6_0_OR_GREATER
|
||||||
|
public void AddPageFactory<TPage, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
||||||
|
#else
|
||||||
public void AddPageFactory<TPage, TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
public void AddPageFactory<TPage, TPageFactory>() where TPageFactory : IPageFactory<TPage>
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
pages.AddPageFactory<TPage, TPageFactory>();
|
pages.AddPageFactory<TPage, TPageFactory>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user