示例#1
0
        internal static bool TryResolveGlobally(this DependencySource source, [NotNull] Type type, out object result,
                                                out DependencySource actualSource)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            for (var index = RootDependencyContainer.InstancesCount - 1; index >= 0; index--)
            {
                var container = RootDependencyContainer.GetInstance(index);
                if (source.TryResolveGlobally(container, type, out result, out actualSource))
                {
                    return(true);
                }
            }

            result       = default;
            actualSource = default;
            return(false);
        }
示例#2
0
 public static bool TryResolve(this DependencySource source, ResolutionContext context, Type type,
                               out object result,
                               out DependencySource actualSource) =>
 source.TryResolveInGameObject(context, type, out result, out actualSource) ||
 source.TryResolveGlobally(type, out result, out actualSource);
 public static bool TryResolve(this DependencySource source, Context context, Type type, out object result) =>
 source.TryResolveInGameObject(context, type, out result) ||
 source.TryResolveGlobally(type, out result);