Skip to content

Commit a0a1891

Browse files
committed
Added ExcelFunctionExecutionHandlerSelector example.
1 parent 0c7a8a0 commit a0a1891

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/guides-basic/dotnet-native-aot-support.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,29 @@ public static TestType1 NativeReturnTestType1(string s)
586586
| A1 | =NativeVersion2("4.3.2.1") | The Native Version value with field count 2 is 4.3
587587
| A2 | =NativeReturnTestType1("world") | The Native TestType1 return value is world
588588

589+
# Function execution handler
590+
591+
```csharp
592+
public class FunctionLoggingHandler : FunctionExecutionHandler
593+
{
594+
public override void OnSuccess(FunctionExecutionArgs args)
595+
{
596+
System.Diagnostics.Trace.WriteLine($"OnSuccess - Result: {args.ReturnValue}");
597+
}
598+
599+
[ExcelFunctionExecutionHandlerSelector]
600+
public static IFunctionExecutionHandler LoggingHandlerSelector(IExcelFunctionInfo functionInfo)
601+
{
602+
return new FunctionLoggingHandler();
603+
}
604+
}
605+
```
606+
607+
| Cell | Formula | Result
608+
| --------- | ----------------------| ------
609+
| A1 | =NativeHello("world") | Hello world!
610+
| DebugView | | OnSuccess - Result: Hello world!
611+
589612
# Not supported functionality in native add-ins
590613

591614
Loading images for ribbon controls.

0 commit comments

Comments
 (0)