コード例 #1
0
        public object BuildUp([NotNull] ExportMetadata data, ErrorTracer errorTracer, params BuildParameter[] parameters)
        {
            try
            {
                errorTracer.Export = data.ToString();
                return _buildEngine.BuildUp(data.Export, data.ContractName, errorTracer, parameters);
            }
            catch (Exception e)
            {
                if (e is BuildUpException) throw;

                errorTracer.Exception = e;

                throw new BuildUpException(errorTracer);
                //throw new BuildUpException(string.Format("Build Error: {0}", data), e);
            }
        }
コード例 #2
0
        /// <summary>
        ///     The find exports.
        /// </summary>
        /// <param name="interfaceType">
        ///     The interface.
        /// </param>
        /// <param name="name">
        ///     The name.
        /// </param>
        /// <returns>
        ///     The <see cref="IEnumerable" />.
        /// </returns>
        public IEnumerable<ExportMetadata> FindExports(Type interfaceType, string name, ErrorTracer errorTracer)
        {
            try
            {
                return _exports.FindAll(interfaceType, name, errorTracer);
            }
            catch (Exception e)
            {
                errorTracer.Exceptional = true;
                errorTracer.Exception = e;

                //if (e is FindExportException) throw;

                //throw new FindExportException(string.Format("Resolve Failed: [{0}|{1}]", interfaceType, name), e);
            }

            return null;
        }
コード例 #3
0
 public IEnumerable<ExportMetadata> FindExports(Type interfaceType, string name, ErrorTracer errorTracer, int level)
 {
     return _exports.FindAll(interfaceType, name, errorTracer, level);
 }
コード例 #4
0
        /// <summary>
        ///     The find export.
        /// </summary>
        /// <param name="interfaceType">
        ///     The interface.
        /// </param>
        /// <param name="name">
        ///     The name.
        /// </param>
        /// <param name="isOptional">
        ///     The optional.
        /// </param>
        /// <returns>
        ///     The <see cref="ExportMetadata" />.
        /// </returns>
        public ExportMetadata FindExport(Type interfaceType, string name,  ErrorTracer errorTracer, bool isOptional)
        {
            try
            {
                return isOptional ? _exports.FindOptional(interfaceType, name, errorTracer) : FindExport(interfaceType, name, errorTracer);
            }
            catch (Exception e)
            {
                errorTracer.Exceptional = true;
                errorTracer.Exception = e;
                //if (e is FindExportException) throw;

                //throw new FindExportException(string.Format("Resolve Failed: [{0}|{1}]", interfaceType, name), e);
            }

            return null;
        }
コード例 #5
0
 public ExportMetadata FindExport(Type interfaceType, string name, ErrorTracer errorTracer, bool isOptional, int level)
 {
     return isOptional
                ? _exports.FindOptional(interfaceType, name, errorTracer, level)
                : _exports.FindSingle(interfaceType, name, errorTracer, level);
 }
コード例 #6
0
        /// <summary>
        ///     The build up.
        /// </summary>
        /// <param name="toBuild">
        ///     The object.
        /// </param>
        /// <param name="errorTracer"></param>
        /// <param name="parameters"></param>
        /// <returns>
        ///     The <see cref="object" />.
        /// </returns>
        public object BuildUp(object toBuild, ErrorTracer errorTracer, params BuildParameter[] parameters)
        {
            try
            {
                return _buildEngine.BuildUp(toBuild, errorTracer, parameters);
            }
            catch (Exception e)
            {
                if (e is BuildUpException) throw;

                errorTracer.Exception = e;

                throw new BuildUpException(errorTracer);
                //throw new BuildUpException(string.Format("Instance Build Error: {0}", toBuild), e);
            }
        }
コード例 #7
0
        /// <summary>
        ///     The build up.
        /// </summary>
        /// <param name="type">
        ///     The type.
        /// </param>
        /// <param name="constructorArguments">
        ///     The constructor arguments.
        /// </param>
        /// <returns>
        ///     The <see cref="object" />.
        /// </returns>
        public object BuildUp(Type type,  ErrorTracer errorTracer, BuildParameter[] buildParameters, params object[] constructorArguments)
        {
            try
            {
                return _buildEngine.BuildUp(type, constructorArguments, errorTracer, buildParameters);
            }
            catch (Exception e)
            {
                if (e is BuildUpException) throw;

                errorTracer.Exception = e;
                throw new BuildUpException(errorTracer);
                //throw new BuildUpException(string.Format("Type Build Error: {0}", type), e);
            }
        }
コード例 #8
0
        public IEnumerable<ExportMetadata> FindExports(Type interfaceType, string name, ErrorTracer errorTracer, int level)
        {
            Contract.Requires<ArgumentNullException>(interfaceType != null, "interfaceType");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            throw new NotImplementedException();
        }
コード例 #9
0
        /// <summary>
        ///     The find export.
        /// </summary>
        /// <param name="interfaceType">
        ///     The interface type.
        /// </param>
        /// <param name="name">
        ///     The name.
        /// </param>
        /// <returns>
        ///     The <see cref="ExportMetadata" />.
        /// </returns>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public ExportMetadata FindExport(Type interfaceType, string name, ErrorTracer errorTracer)
        {
            Contract.Requires<ArgumentNullException>(interfaceType != null, "interfaceType");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            throw new NotImplementedException();
        }
コード例 #10
0
        /// <summary>
        ///     The build up.
        /// </summary>
        /// <param name="type">
        ///     The type.
        /// </param>
        /// <param name="constructorArguments">
        ///     The constructor arguments.
        /// </param>
        /// <returns>
        ///     The <see cref="object" />.
        /// </returns>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public object BuildUp(Type type, ErrorTracer errorTracer, BuildParameter[] buildParameters, params object[] constructorArguments)
        {
            Contract.Requires<ArgumentNullException>(type != null, "type");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            throw new NotImplementedException();
        }
コード例 #11
0
        /// <summary>
        ///     The build up.
        /// </summary>
        /// <param name="toBuild">
        ///     The to build.
        /// </param>
        /// <param name="errorTracer"></param>
        /// <param name="parameters"></param>
        /// <returns>
        ///     The <see cref="object" />.
        /// </returns>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public object BuildUp(object toBuild, ErrorTracer errorTracer, params BuildParameter[] parameters)
        {
            Contract.Requires<ArgumentNullException>(toBuild != null, "toBuild");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            throw new NotImplementedException();
        }
コード例 #12
0
        /// <summary>
        ///     The build up.
        /// </summary>
        /// <param name="data">
        ///     The data.
        /// </param>
        /// <param name="errorTracer"></param>
        /// <param name="parameters"></param>
        /// <returns>
        ///     The <see cref="object" />.
        /// </returns>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public object BuildUp(ExportMetadata data, ErrorTracer errorTracer, params BuildParameter[] parameters)
        {
            Contract.Requires<ArgumentNullException>(data != null, "data");
            Contract.Requires<ArgumentNullException>(errorTracer != null, "errorTracer");

            throw new NotImplementedException();
        }