Skip to content

Commit 45ee9c0

Browse files
committed
Added enum examples.
1 parent 63339a8 commit 45ee9c0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,30 @@ public static string NativeRangeAddress(IRange r)
313313
| A2 | =NativeRangeAddress(B2:C4) | Native Address: $B$2:$C$4
314314
| A3 | =NativeRangeAddress((B2,D5:E6)) | Native Address: $B$2,$D$5:$E$6
315315

316+
## Enums parameter and return value
317+
318+
```csharp
319+
[ExcelFunction]
320+
public static string NativeEnum(DateTimeKind e)
321+
{
322+
return "Native Enum VAL: " + e.ToString();
323+
}
324+
325+
[ExcelFunction]
326+
public static DateTimeKind NativeEnumReturn(string s)
327+
{
328+
return Enum.Parse<DateTimeKind>(s);
329+
}
330+
```
331+
332+
| Cell | Formula | Result
333+
| ----- | -------------------------------- | ------
334+
| A1 | =NativeEnum("Unspecified") | Native Enum VAL: Unspecified
335+
| A2 | =NativeEnum("Local") | Native Enum VAL: Local
336+
| A3 | =NativeEnum(1) | Native Enum VAL: Utc
337+
| A4 | =NativeEnumReturn("Unspecified") | Unspecified
338+
| A5 | =NativeEnumReturn("Local") | Local
339+
316340
# Not supported functionality in native add-ins
317341

318342
Loading images for ribbon controls.

0 commit comments

Comments
 (0)