/// <summary> /// Calls <see cref="PropertyInfo.GetValue(object, object[])"/> on the original /// <see cref="PropertyInfo"/>. /// </summary> public object GetOriginal(object obj, params object[] indices) { if (GetRedirection == null) { throw new InvalidOperationException("A get method must be defined."); } return(GetRedirection.InvokeOriginal(obj, indices)); }
/// <summary> /// Starts redirecting the <see langword="get"/> and <see langword="set"/> methods. /// </summary> public override void Stop() { // Always stop them, because the user might have changed // their state individually GetRedirection?.Stop(); SetRedirection?.Stop(); if (!isRedirecting) { return; } isRedirecting = false; }
/// <inheritdoc /> public override void Dispose() { GetRedirection?.Dispose(); SetRedirection?.Dispose(); }