Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        /// <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;
        }
Ejemplo n.º 3
0
 /// <inheritdoc />
 public override void Dispose()
 {
     GetRedirection?.Dispose();
     SetRedirection?.Dispose();
 }