forked from ltrzesniewski/InlineIL.Fody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStandAloneMethodSig.cs
62 lines (57 loc) · 2.95 KB
/
StandAloneMethodSig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.InteropServices;
namespace InlineIL
{
/// <summary>
/// Represents a stand-alone method signature,
/// for use with <see cref="IL.Emit.Calli" />.
/// </summary>
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
[SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Global")]
public sealed class StandAloneMethodSig
{
/// <summary>
/// Constructs an unmanaged method signature for the <c>calli</c> opcode.
/// </summary>
/// <param name="callingConvention">The unmanaged calling convention.</param>
/// <param name="returnType">The method return type.</param>
/// <param name="parameterTypes">The method parameter types.</param>
public StandAloneMethodSig(CallingConvention callingConvention, TypeRef returnType, params TypeRef[] parameterTypes)
{
}
/// <summary>
/// Constructs a managed method signature for the <c>calli</c> opcode.
/// </summary>
/// <param name="callingConvention">The managed calling convention.</param>
/// <param name="returnType">The method return type.</param>
/// <param name="parameterTypes">The method parameter types.</param>
public StandAloneMethodSig(CallingConventions callingConvention, TypeRef returnType, params TypeRef[] parameterTypes)
{
}
/// <summary>
/// Constructs an unmanaged method signature for the <c>calli</c> opcode.
/// </summary>
/// <param name="callingConvention">The unmanaged calling convention.</param>
/// <param name="returnType">The method return type.</param>
/// <param name="parameterTypes">The method parameter types.</param>
public static StandAloneMethodSig UnmanagedMethod(CallingConvention callingConvention, TypeRef returnType, params TypeRef[] parameterTypes)
=> throw IL.Throw();
/// <summary>
/// Constructs a managed method signature for the <c>calli</c> opcode.
/// </summary>
/// <param name="callingConvention">The managed calling convention.</param>
/// <param name="returnType">The method return type.</param>
/// <param name="parameterTypes">The method parameter types.</param>
public static StandAloneMethodSig ManagedMethod(CallingConventions callingConvention, TypeRef returnType, params TypeRef[] parameterTypes)
=> throw IL.Throw();
/// <summary>
/// Specifies the optional parameter types for a managed varargs method call.
/// </summary>
/// <param name="optionalParameterTypes">The optional parameter types.</param>
/// <returns>A reference to a varargs method call signature.</returns>
public StandAloneMethodSig WithOptionalParameters(params TypeRef[] optionalParameterTypes)
=> throw IL.Throw();
}
}