[AttributeUsage(AttributeTargets.Interface)]
public class GeneratedComInterfaceAttribute : Attribute
{
- public GeneratedComInterfaceAttribute(Type comWrappersType)
- => (ComWrappersType) = (comWrappersType);
-
- public GeneratedComInterfaceAttribute(Type comWrappersType, bool generateManagedObjectWrapper, bool generateComObjectWrapper)
- => (ComWrappersType, GenerateManagedObjectWrapper, GenerateComObjectWrapper)
- = (comWrappersType, generateManagedObjectWrapper, generateComObjectWrapper);
-
- public Type ComWrappersType { get; }
-
- public bool GenerateManagedObjectWrapper { get; } = true;
-
- public bool GenerateComObjectWrapper { get; } = true;
-
- public bool ExportInterfaceDefinition { get; }
}
}
string snippet =
$$$"""
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[InterfaceTypeAttribute((short)1)]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute((short)2)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIInspectable)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute((short)3)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
$$$"""
[{|#0:InterfaceTypeAttribute((short)0)|}]
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
interface IFoo
{
void Bar() {}
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase
void Bar() {}
}
- [GeneratedComInterface(typeof(MyComWrappers))]
+ [GeneratedComInterface]
partial interface IFoo { }
public unsafe partial class MyComWrappers : GeneratedComWrappersBase