SecurityTokenRequirement.TryGetProperty<TValue>(String, TValue) Método
Definição
Obtém a propriedade especificada para a instância SecurityTokenRequirement atual.Gets the specified property for the current SecurityTokenRequirement instance.
public:
generic <typename TValue>
bool TryGetProperty(System::String ^ propertyName, [Runtime::InteropServices::Out] TValue % result);
public:
generic <typename TValue>
bool TryGetProperty(System::String ^ property, [Runtime::InteropServices::Out] TValue % value);
public bool TryGetProperty<TValue> (string propertyName, out TValue result);
public bool TryGetProperty<TValue> (string property, out TValue value);
member this.TryGetProperty : string * 'Value -> bool
member this.TryGetProperty : string * 'Value -> bool
Public Function TryGetProperty(Of TValue) (propertyName As String, ByRef result As TValue) As Boolean
Public Function TryGetProperty(Of TValue) (property As String, ByRef value As TValue) As Boolean
Parâmetros de tipo
- TValue
O tipo de propriedade a ser retornado no result parâmetro.The type of property to return in the result parameter.
Parâmetros
- propertyNameproperty
- String
O nome da propriedade a ser obtida.The name of the property to get.
- resultvalue
- TValue
O valor da propriedade especificada na propriedade propertyName.The value of the property specified in the propertyName property.
Retornos
true se a propriedade Properties contiver um valor da propriedade para a propriedade especificada na propriedade propertyName; caso contrário, false.true if the Properties property contains a property value for the property specified in the propertyName property; otherwise, false.
Exceções
Existe uma propriedade com o nome especificado no parâmetro propertyName, mas não é do mesmo tipo especificado no parâmetro TValue.A properties exists with the name specified in the propertyName parameter, but it is not of the same type that is specified in the TValue parameter.
Comentários
Para obter o valor da propriedade da propriedade especificada e verificar se o valor da propriedade pode ser definido como o tipo especificado no TValue parâmetro, chame o GetProperty<TValue>(String) método.To get the property value of the specified property and verify that property value can be set to the type specified in the TValue parameter, call the GetProperty<TValue>(String) method.