/// <summary> /// Assembles the section based on the input arguments. /// </summary> /// <param name="sectionResult">The section result to assemble.</param> /// <param name="failureMechanism">The failure mechanism the section result belongs to.</param> /// <param name="assessmentSection">The <see cref="IAssessmentSection"/> the section belongs to.</param> /// <returns>A <see cref="FailureMechanismSectionAssemblyResultWrapper"/>.</returns> /// <exception cref="ArgumentNullException">Thrown when any argument is <c>null</c>.</exception> /// <exception cref="AssemblyException">Thrown when the section could not be assembled.</exception> public static FailureMechanismSectionAssemblyResultWrapper AssembleSection(NonAdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult, IHasGeneralInput failureMechanism, IAssessmentSection assessmentSection) { if (sectionResult == null) { throw new ArgumentNullException(nameof(sectionResult)); } if (failureMechanism == null) { throw new ArgumentNullException(nameof(failureMechanism)); } if (assessmentSection == null) { throw new ArgumentNullException(nameof(assessmentSection)); } return(FailureMechanismSectionAssemblyResultFactory.AssembleSection( sectionResult, assessmentSection, failureMechanism.GeneralInput.ApplyLengthEffectInSection)); }
/// <summary> /// Creates an implementation of <see cref="IStandAloneFailureMechanismMetaEntity"/> based on the information /// of the <see cref="IHasGeneralInput"/>. /// </summary> /// <param name="mechanism">The implementation of <see cref="IHasGeneralInput"/>.</param> /// <typeparam name="TFailureMechanismMetaEntity">The implementation of <see cref="IStandAloneFailureMechanismMetaEntity"/>.</typeparam> /// <returns>A new <see cref="TFailureMechanismMetaEntity"/>.</returns> internal static TFailureMechanismMetaEntity Create <TFailureMechanismMetaEntity>(this IHasGeneralInput mechanism) where TFailureMechanismMetaEntity : IStandAloneFailureMechanismMetaEntity, new() { return(new TFailureMechanismMetaEntity { N = mechanism.GeneralInput.N, ApplyLengthEffectInSection = Convert.ToByte(mechanism.GeneralInput.ApplyLengthEffectInSection) }); }