/// <summary> /// Get the specialized property value. /// </summary> //6.0 TODO: Merge into IAccessOptimizer. internal static object GetSpecializedPropertyValue(this IAccessOptimizer optimizer, object target) { if (optimizer is AccessOptimizer accessOptimizer) { return(accessOptimizer.GetSpecializedPropertyValue(target)); } throw new InvalidOperationException($"{optimizer.GetType()} does not support {nameof(GetPropertyValue)} method."); }
/// <summary> /// Set the property value on the given index. /// </summary> //6.0 TODO: Merge into IAccessOptimizer. public static void SetPropertyValue(this IAccessOptimizer optimizer, object target, int i, object value) { if (optimizer is AccessOptimizer accessOptimizer) { accessOptimizer.SetPropertyValue(target, i, value); return; } throw new InvalidOperationException($"{optimizer.GetType()} does not support {nameof(SetPropertyValue)} method."); }