B-Arts DocumentationIndice generale

BValueProperty - Esempi

Risultato della lettura riflessiva

using B.BReflections;
using System.Reflection;

CustomerEditor customer = new CustomerEditor();
PropertyInfo property = typeof(CustomerEditor).GetProperty("CompanyName")!;

BValueProperty? result = BReflection.GetBValueProperty(customer, property);

if (result?.Behavior == BValueProperty.eBehavior.Standard)
{
  Type? propertyType = result.Type;
  object? value = result.Value;
}

Standard indica una proprietà leggibile normalmente. NotRead viene usato per proprietà indicizzate o con setter non pubblico rilevato dal framework. Non interpretare Value senza controllare anche Behavior e Type.