| Visual Basic (Declaration) | |
|---|---|
Public Shared Sub SetEnumFromInt32( _ ByVal target As RemotableObject, _ ByVal propertyName As String, _ ByVal value As Integer _ ) | |
| C# | |
|---|---|
public static void SetEnumFromInt32( RemotableObject target, string propertyName, int value ) | |
| C++/CLI | |
|---|---|
public: static void SetEnumFromInt32( RemotableObject^ target, String^ propertyName, int value ) | |
Parameters
- target
- The object on which to access the flags-type enumerated property.
- propertyName
- The name of the flag-type enumerated property.
- value
- The value from which to set the property.
| Exception | Description |
|---|---|
| System.ArgumentException | Is raised if either the target or propertyName argument is null, or if the propertyName property cannot be found on target. |
| System.InvalidOperationException | Is raised of the type of the named property is not a flag-type enumeration, or if the named property is not writable. |
Some 3rd party packages are unable to manipulate flag-type enumerations. This method allows such packages to set a flag-type enumerated value from a 32-bit integer. The package can then use bitwise integer operations to construct an integer containing the required flags.
Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)