Esempio n. 1
0
        private void buildResolver(Scope scope)
        {
            if (_resolver != null)
            {
                return;
            }

            lock (_locker)
            {
                if (_resolver != null)
                {
                    return;
                }

                if (ErrorMessages.Any() || Dependencies.Any(x => x.ErrorMessages.Any()))
                {
                    var errorResolver = new ErrorMessageResolver(this);
                    _resolver = errorResolver.Resolve;
                }
                else
                {
                    _resolver = BuildFuncResolver(scope);
                }
            }
        }
Esempio n. 2
0
        public void AttachResolver(Scope root)
        {
            if (ErrorMessages.Any() || Dependencies.Any(x => x.ErrorMessages.Any()))
            {
                _resolver = new ErrorMessageResolver(this);
            }
            else
            {
                _resolver = (IResolver)root.QuickBuild(_resolverType.CompiledType);
                _resolverType.ApplySetterValues(_resolver);
            }

            _resolver.Hash = GetHashCode();
            _resolver.Name = Name;
        }