Ejemplo n.º 1
0
        /// <summary>
        ///   Builds all units represented by <see cref="UnitInfo" />
        /// </summary>
        /// <param name="unitInfo">Building unit "id"</param>
        /// <param name="auxBuildPlans">Additional build plans to build a unit or its dependencies</param>
        /// <returns>Returns an instance or null if null is registered as a unit.</returns>
        /// <exception cref="ArmatureException">Throws if unit wasn't built by this or any parent containers</exception>
        public IReadOnlyList <object> BuildAllUnits(UnitInfo unitInfo, BuildPlansCollection auxBuildPlans = null)
        {
            var buildResult = Build(unitInfo, auxBuildPlans, BuildSession.BuildAllUnits, _parentBuilders);

            return(buildResult.Select(_ => _.Value).ToArray());
        }
Ejemplo n.º 2
0
 /// <summary>
 ///   Builds a unit represented by <see cref="UnitInfo" />
 /// </summary>
 /// <param name="unitInfo">Building unit "id"</param>
 /// <param name="auxBuildPlans">Additional build plans to build a unit or its dependencies</param>
 /// <returns>Returns an instance or null if null is registered as a unit.</returns>
 /// <exception cref="ArmatureException">Throws if unit wasn't built by this or any parent containers</exception>
 public BuildResult BuildUnit(UnitInfo unitInfo, BuildPlansCollection auxBuildPlans = null) =>
 Build(unitInfo, auxBuildPlans, BuildSession.BuildUnit, _parentBuilders);
Ejemplo n.º 3
0
 public BuildResult BuildUnit(UnitInfo unitInfo) => Build(unitInfo, BuildUnit);
Ejemplo n.º 4
0
 public IReadOnlyList <BuildResult> BuildAllUnits(UnitInfo unitInfo) => Build(unitInfo, BuildAllUnits);
Ejemplo n.º 5
0
 /// <summary>
 ///   Builds all Units represented by <paramref name="unitInfo" />
 /// </summary>
 /// <param name="unitInfo">"Id" of the unit to build. See <see cref="IUnitSequenceMatcher" /> for details</param>
 /// <param name="buildStages">The conveyor of build stages. See <see cref="Builder" /> for details</param>
 /// <param name="buildPlans">Build plans used to build a unit</param>
 /// <param name="runtimeBuildPlans">Build plans collection contains additional build plans passed into <see cref="Builder.BuildUnit" /> method </param>
 /// <param name="parentBuilders">
 ///   If unit is not built and <paramref name="parentBuilders" /> are provided, trying to build a unit using
 ///   parent builders one by one in the order they passed into constructor
 /// </param>
 public static IReadOnlyList <BuildResult> BuildAllUnits(
     [NotNull] UnitInfo unitInfo,
     [NotNull] IEnumerable <object> buildStages,
     [NotNull] BuildPlansCollection buildPlans,
     [CanBeNull] BuildPlansCollection runtimeBuildPlans,
     [CanBeNull] Builder[] parentBuilders) => new BuildSession(buildStages, buildPlans, runtimeBuildPlans, parentBuilders).BuildAllUnits(unitInfo);