-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97dc9b6
commit 7c59303
Showing
10 changed files
with
206 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...bj/GeneratedFiles/AspectGenerator/AspectGenerator.AspectSourceGenerator/Interceptors.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// <auto-generated/> | ||
#pragma warning disable | ||
#nullable enable | ||
|
||
using System; | ||
|
||
using SR = System.Reflection; | ||
using SLE = System.Linq.Expressions; | ||
using SCG = System.Collections.Generic; | ||
|
||
namespace MultiProjectAspectGenerator | ||
{ | ||
using AspectGenerator = AspectGenerator; | ||
|
||
static partial class Interceptors | ||
{ | ||
static SR.MethodInfo GetMethodInfo(SLE.Expression expr) | ||
{ | ||
return expr switch | ||
{ | ||
SLE.MethodCallExpression mc => mc.Method, | ||
_ => throw new InvalidOperationException() | ||
}; | ||
} | ||
|
||
static SR.MethodInfo MethodOf<T>(SLE.Expression<Func<T>> func) => GetMethodInfo(func.Body); | ||
static SR.MethodInfo MethodOf (SLE.Expression<Action> func) => GetMethodInfo(func.Body); | ||
|
||
static SR. MemberInfo TestMethod_Interceptor_MemberInfo = MethodOf(() => ClassLibrary.TestClass.TestMethod(default(string))); | ||
static SCG.Dictionary<string,object?> TestMethod_Interceptor_AspectArguments_0 = new() | ||
{ | ||
}; | ||
// | ||
/// <summary> | ||
/// Intercepts ClassLibrary.TestClass.TestMethod(string). | ||
/// </summary> | ||
// | ||
// Intercepts ClassLibrary.TestClass.TestMethod("Test"). | ||
[System.Runtime.CompilerServices.InterceptsLocation(@"P:\AspectGenerator\Examples\MultiProject\MainApp\Program.cs", line: 12, character: 36)] | ||
// | ||
[System.Runtime.CompilerServices.CompilerGenerated] | ||
//[System.Diagnostics.DebuggerStepThrough] | ||
public static string TestMethod_Interceptor(string str) | ||
{ | ||
// Aspects.CrossProjectAttribute | ||
// | ||
var __info__0 = new AspectGenerator.InterceptInfo<string> | ||
{ | ||
MemberInfo = TestMethod_Interceptor_MemberInfo, | ||
AspectType = typeof(Aspects.CrossProjectAttribute), | ||
AspectArguments = TestMethod_Interceptor_AspectArguments_0, | ||
}; | ||
|
||
__info__0.ReturnValue = ClassLibrary.TestClass.TestMethod(str); | ||
|
||
__info__0.InterceptType = AspectGenerator.InterceptType.OnAfterCall; | ||
Aspects.CrossProjectAttribute.OnAfterCall(__info__0); | ||
|
||
return __info__0.ReturnValue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.