default options if null (#10)
This commit is contained in:
@@ -14,6 +14,7 @@ Api Assembly:
|
|||||||
|
|
||||||
- Proxy Interfaces that inherit from the base interfaces
|
- Proxy Interfaces that inherit from the base interfaces
|
||||||
- Proxy attribute references wrapped Api
|
- Proxy attribute references wrapped Api
|
||||||
|
- If `ImplementationOptions` is omitted then defaults are used: `ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface`
|
||||||
|
|
||||||
New needs: base interface is used by wrappers. Need to ignore members from wrapped api on demand.
|
New needs: base interface is used by wrappers. Need to ignore members from wrapped api on demand.
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ namespace ProxyInterfaceConsumer.Http;
|
|||||||
[Speckle.ProxyGenerator.Proxy(typeof(HttpClient), ImplementationOptions.ProxyBaseClasses)]
|
[Speckle.ProxyGenerator.Proxy(typeof(HttpClient), ImplementationOptions.ProxyBaseClasses)]
|
||||||
public partial interface IHttpClient : IHttpMessageInvoker { }
|
public partial interface IHttpClient : IHttpMessageInvoker { }
|
||||||
|
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(HttpMessageInvoker))]
|
[Speckle.ProxyGenerator.Proxy(typeof(HttpMessageInvoker), ImplementationOptions.None)]
|
||||||
public partial interface IHttpMessageInvoker { }
|
public partial interface IHttpMessageInvoker { }
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumer
|
namespace ProxyInterfaceConsumer
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(ProxyInterfaceConsumer.PersonT<>))]
|
[Speckle.ProxyGenerator.Proxy(typeof(ProxyInterfaceConsumer.PersonT<>), ImplementationOptions.None)]
|
||||||
public partial interface IPersonT //<T> where T : struct
|
public partial interface IPersonT //<T> where T : struct
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Microsoft.SharePoint.Client;
|
using Microsoft.SharePoint.Client;
|
||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(ClientContext))]
|
[Speckle.ProxyGenerator.Proxy(typeof(ClientContext), ImplementationOptions.None)]
|
||||||
public partial interface IClientContext : IClientRuntimeContext
|
public partial interface IClientContext : IClientRuntimeContext
|
||||||
{
|
{
|
||||||
void Load<TSource, TTarget>(
|
void Load<TSource, TTarget>(
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.ClientObject))]
|
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.ClientObject), ImplementationOptions.None)]
|
||||||
public partial interface IClientObject { }
|
public partial interface IClientObject { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.ClientRuntimeContext))]
|
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.ClientRuntimeContext), ImplementationOptions.None)]
|
||||||
public partial interface IClientRuntimeContext { }
|
public partial interface IClientRuntimeContext { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
//using System.Collections;
|
|
||||||
//using System.Linq;
|
|
||||||
|
|
||||||
//namespace ProxyInterfaceConsumerForPnP.Interfaces
|
|
||||||
//{
|
|
||||||
// [Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.ListCollection))]
|
|
||||||
// public partial interface IProxyListCollection: IClientObject, IEnumerable, IQueryable
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.SecurableObject))]
|
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.SecurableObject), ImplementationOptions.None)]
|
||||||
public partial interface ISecurableObject : IClientObject
|
public partial interface ISecurableObject : IClientObject
|
||||||
{
|
{
|
||||||
// public virtual void X();
|
// public virtual void X();
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.User))]
|
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.User), ImplementationOptions.None)]
|
||||||
public partial interface IUser { }
|
public partial interface IUser { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
using Speckle.ProxyGenerator;
|
||||||
|
|
||||||
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
namespace ProxyInterfaceConsumerForPnP.Interfaces
|
||||||
{
|
{
|
||||||
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.Web))]
|
[Speckle.ProxyGenerator.Proxy(typeof(Microsoft.SharePoint.Client.Web), ImplementationOptions.None)]
|
||||||
public partial interface IWeb : ISecurableObject { }
|
public partial interface IWeb : ISecurableObject { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
<Compile Update="Interfaces\IClientObject.cs">
|
<Compile Update="Interfaces\IClientObject.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="Interfaces\IListCollection.cs">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Interfaces\IUser.cs">
|
<Compile Update="Interfaces\IUser.cs">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>0.1.10</Version>
|
<Version>0.1.11</Version>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>Latest</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis;
|
|||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
using Speckle.ProxyGenerator.Extensions;
|
using Speckle.ProxyGenerator.Extensions;
|
||||||
using Speckle.ProxyGenerator.Models;
|
using Speckle.ProxyGenerator.Models;
|
||||||
|
using Speckle.ProxyGenerator.Types;
|
||||||
|
|
||||||
namespace Speckle.ProxyGenerator.SyntaxReceiver;
|
namespace Speckle.ProxyGenerator.SyntaxReceiver;
|
||||||
|
|
||||||
@@ -99,7 +100,7 @@ internal class ProxySyntaxReceiver : ISyntaxContextReceiver
|
|||||||
fullMetadataTypeName: metadataName,
|
fullMetadataTypeName: metadataName,
|
||||||
shortMetadataTypeName: metadataName.Split('.').Last(),
|
shortMetadataTypeName: metadataName.Split('.').Last(),
|
||||||
usings: usings,
|
usings: usings,
|
||||||
options: fluentBuilderAttributeArguments.Options,
|
options: fluentBuilderAttributeArguments.Options ?? ImplementationOptions.UseExtendedInterfaces | ImplementationOptions.ProxyForBaseInterface,
|
||||||
accessibility: fluentBuilderAttributeArguments.Accessibility,
|
accessibility: fluentBuilderAttributeArguments.Accessibility,
|
||||||
membersToIgnore: fluentBuilderAttributeArguments.MembersToIgnore
|
membersToIgnore: fluentBuilderAttributeArguments.MembersToIgnore
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ internal record ProxyInterfaceGeneratorAttributeArguments(
|
|||||||
string MetadataName
|
string MetadataName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
public ImplementationOptions Options { get; set; }
|
public ImplementationOptions? Options { get; set; }
|
||||||
|
|
||||||
public ProxyClassAccessibility Accessibility { get; set; }
|
public ProxyClassAccessibility Accessibility { get; set; }
|
||||||
public string[] MembersToIgnore { get; set; } = [];
|
public string[] MembersToIgnore { get; set; } = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user