ToolboxItem.ValidatePropertyType(String, Object, Type, Boolean) Metod

Definition

Verifierar att ett objekt är av en viss typ.

protected:
 void ValidatePropertyType(System::String ^ propertyName, System::Object ^ value, Type ^ expectedType, bool allowNull);
protected void ValidatePropertyType(string propertyName, object value, Type expectedType, bool allowNull);
protected void ValidatePropertyType(string propertyName, object? value, Type expectedType, bool allowNull);
member this.ValidatePropertyType : string * obj * Type * bool -> unit
Protected Sub ValidatePropertyType (propertyName As String, value As Object, expectedType As Type, allowNull As Boolean)

Parametrar

propertyName
String

Namnet på egenskapen som ska verifieras.

value
Object

Valfritt värde som ska valideras mot.

expectedType
Type

Den förväntade typen av egenskapen.

allowNull
Boolean

true för att tillåta null; annars false.

Undantag

value är nulloch allowNull är false.

value är inte den typ som anges av expectedType.

Kommentarer

Metoden ValidatePropertyType anropas som en hjälpmetod för ValidatePropertyValue metoden.

Gäller för