DynamicTryResolve() публичный статический Метод

Attempts to resolve a given object of an unknown type.
If item is a resolvable cecil type, then it will be resolved. If it is already resolved (i.e. a member definition) or if it is not a resolvable type, then it will not be resolved.
public static DynamicTryResolve ( dynamic item, object &resolvedItem ) : bool
item dynamic Item to possibly resolve.
resolvedItem object If the resolve was necesary, then this will be populated with the resolved item, otherwise it will be given the value of .
Результат bool
Пример #1
0
        /// <summary>
        /// Invokes the behavior.
        /// </summary>
        /// <param name="item">Item on which to invoke the behavior.</param>
        /// <returns>Result of the invocation.</returns>
        private TReturn InvokeForItem(object item)
        {
            Contract.Requires(item != null);

            if (DynamicResolver.DynamicTryResolve(item, out object resolvedItem))
            {
                // if a resolvable reference was passed in, that would be considered an
                // error because it means that the source graph may contain a reference where
                // a definition was expected
                throw new InvalidOperationException(string.Format(
                                                        "Cannot invoke on resolvable items of type {0}. Resolve the item first.",
                                                        item.GetType().FullName));
            }

            return(this.InvokeForNonILItem(item));
        }