Share via


PropertyInformation.IsRequired 属性

定义

获取指定是否需要配置特性的值。

public:
 property bool IsRequired { bool get(); };
public bool IsRequired { get; }
member this.IsRequired : bool
Public ReadOnly Property IsRequired As Boolean

属性值

如果 PropertyInformation 对象是必需的,则为 true;否则为 false

示例

下面的代码示例演示如何使用 IsRequired 属性。 此代码示例是为 PropertyInformation 类提供的一个更大示例的一部分。

// Display the IsRequired property.
Console.WriteLine("IsRequired: {0}", propertyItem.IsRequired);
' Display the IsRequired property.
Console.WriteLine("IsRequired: {0}", propertyItem.IsRequired)

适用于