TryGetPropertyGeneric<T> method

bool TryGetPropertyGeneric<T>(
  1. PropertyDefinitionBase propertyDefinition,
  2. OutParam<T> propertyValueOutParam
)
Try to get the value of a specified property in this instance. The property definition. The property value.

Implementation

bool TryGetPropertyGeneric<T>(PropertyDefinitionBase propertyDefinition,
    OutParam<T> propertyValueOutParam) {
  PropertyDefinition propDef = propertyDefinition as PropertyDefinition;
  if (propDef != null) {
    return this
        .PropertyBag
        .TryGetPropertyTypeGeneric<T>(propDef, propertyValueOutParam);
  } else {
    ExtendedPropertyDefinition extPropDef =
        propertyDefinition as ExtendedPropertyDefinition;
    if (extPropDef != null) {
      return this
          .TryGetExtendedProperty<T>(extPropDef, propertyValueOutParam);
    } else {
      // Other subclasses of PropertyDefinitionBase are not supported.
      throw new NotSupportedException("""string.Format(
                      Strings.OperationNotSupportedForPropertyDefinitionType,
                      propertyDefinition.GetType().Name)""");
    }
  }
}