You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,7 +282,43 @@ You can set the default metadata source to use for a whole project by setting th
282
282
</PropertyGroup>
283
283
```
284
284
285
-
You can override the name of the extension class by setting `ExtensionClassName` in the attribute and/or the namespace of the class by setting `ExtensionClassNamespace`. By default, the class will be public if the enum is public, otherwise it will be internal.
285
+
You can override the name of the extension class by setting `ExtensionClassName` in the attribute and/or the namespace of the class by setting `ExtensionClassNamespace`.
286
+
287
+
### Controlling extension accessibility
288
+
289
+
By default, the generated extension class is `public` if the enum is `public`, and `internal` if the enum is `internal`. You can control the accessibility of the generated extension classes in two ways:
290
+
291
+
**Global Configuration (MSBuild Property):**
292
+
293
+
Set the `EnumGenerator_ForceInternal` property in your project file to force all generated extension classes to be `internal`:
294
+
295
+
```xml
296
+
<PropertyGroup>
297
+
<!-- Make all generated extension classes internal -->
- If the global `EnumGenerator_ForceInternal` MSBuild property is set to `true`, all extensions will be internal regardless of the `IsInternal` attribute setting
338
-
- External enums (referenced via `[EnumExtensions<T>]`) also support the `IsInternal` property
- If the global `EnumGenerator_ForceInternal` MSBuild property is set to `true`, all extensions will be internal regardless of the `IsInternal` attribute setting
340
-
- External enums (referenced via `[EnumExtensions<T>]`) also support the `IsInternal` property
0 commit comments