/// <summary>
        /// Creates a new instance of <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResultRow"/>.
        /// </summary>
        /// <param name="sectionResult">The <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResult"/> that is
        /// the source of this row.</param>
        /// <param name="calculateProbabilityStrategy">The strategy used to calculate probabilities.</param>
        /// <param name="failureMechanismSectionResultRowErrorProvider">The error provider to use for
        /// the failure mechanism section result row.</param>
        /// <param name="performAssemblyFunc">Function to perform the assembly.</param>
        /// <param name="getApplyLengthEffectInSectionFunc">Function to get the apply length effect in section indicator.</param>
        /// <param name="constructionProperties">The property values required to create an instance of
        /// <see cref="AdoptableWithProfileProbabilityFailureMechanismSectionResultRow"/>.</param>
        /// <exception cref="ArgumentNullException">Throw when any parameter is <c>null</c>.</exception>
        public AdoptableWithProfileProbabilityFailureMechanismSectionResultRow(AdoptableWithProfileProbabilityFailureMechanismSectionResult sectionResult,
                                                                               IFailureMechanismSectionResultCalculateProbabilityStrategy calculateProbabilityStrategy,
                                                                               IFailureMechanismSectionResultRowWithCalculatedProbabilityErrorProvider failureMechanismSectionResultRowErrorProvider,
                                                                               Func <FailureMechanismSectionAssemblyResultWrapper> performAssemblyFunc,
                                                                               Func <bool> getApplyLengthEffectInSectionFunc,
                                                                               ConstructionProperties constructionProperties)
            : base(sectionResult)
        {
            if (calculateProbabilityStrategy == null)
            {
                throw new ArgumentNullException(nameof(calculateProbabilityStrategy));
            }

            if (failureMechanismSectionResultRowErrorProvider == null)
            {
                throw new ArgumentNullException(nameof(failureMechanismSectionResultRowErrorProvider));
            }

            if (performAssemblyFunc == null)
            {
                throw new ArgumentNullException(nameof(performAssemblyFunc));
            }

            if (getApplyLengthEffectInSectionFunc == null)
            {
                throw new ArgumentNullException(nameof(getApplyLengthEffectInSectionFunc));
            }

            if (constructionProperties == null)
            {
                throw new ArgumentNullException(nameof(constructionProperties));
            }

            this.calculateProbabilityStrategy = calculateProbabilityStrategy;
            this.failureMechanismSectionResultRowErrorProvider = failureMechanismSectionResultRowErrorProvider;
            this.performAssemblyFunc = performAssemblyFunc;
            this.getApplyLengthEffectInSectionFunc = getApplyLengthEffectInSectionFunc;

            initialFailureMechanismResultTypeIndex = constructionProperties.InitialFailureMechanismResultTypeIndex;
            initialFailureMechanismResultProfileProbabilityIndex = constructionProperties.InitialFailureMechanismResultProfileProbabilityIndex;
            initialFailureMechanismResultSectionProbabilityIndex = constructionProperties.InitialFailureMechanismResultSectionProbabilityIndex;
            furtherAnalysisTypeIndex       = constructionProperties.FurtherAnalysisTypeIndex;
            probabilityRefinementTypeIndex = constructionProperties.ProbabilityRefinementTypeIndex;
            refinedProfileProbabilityIndex = constructionProperties.RefinedProfileProbabilityIndex;
            refinedSectionProbabilityIndex = constructionProperties.RefinedSectionProbabilityIndex;
            profileProbabilityIndex        = constructionProperties.ProfileProbabilityIndex;
            sectionProbabilityIndex        = constructionProperties.SectionProbabilityIndex;
            sectionNIndex      = constructionProperties.SectionNIndex;
            assemblyGroupIndex = constructionProperties.AssemblyGroupIndex;

            CreateColumnStateDefinitions();

            Update();
        }
        /// <summary>
        /// Creates a new instance of <see cref="AdoptableFailureMechanismSectionResultRow"/>.
        /// </summary>
        /// <param name="sectionResult">The <see cref="AdoptableFailureMechanismSectionResult"/> that is
        /// the source of this row.</param>
        /// <param name="calculateInitialFailureMechanismResultProbabilityFunc">The <see cref="Func{TResult}"/>
        /// to calculate the initial mechanism result probability.</param>
        /// <param name="failureMechanismSectionResultRowErrorProvider">The error provider to use for
        /// the failure mechanism section result row.</param>
        /// <param name="performAssemblyFunc">Function to perform the assembly.</param>
        /// <param name="constructionProperties">The property values required to create an instance of
        /// <see cref="AdoptableFailureMechanismSectionResultRow"/>.</param>
        /// <exception cref="ArgumentNullException">Throw when any parameter is <c>null</c>.</exception>
        public AdoptableFailureMechanismSectionResultRow(AdoptableFailureMechanismSectionResult sectionResult,
                                                         Func <double> calculateInitialFailureMechanismResultProbabilityFunc,
                                                         IFailureMechanismSectionResultRowWithCalculatedProbabilityErrorProvider failureMechanismSectionResultRowErrorProvider,
                                                         Func <FailureMechanismSectionAssemblyResultWrapper> performAssemblyFunc,
                                                         ConstructionProperties constructionProperties)
            : base(sectionResult)
        {
            if (calculateInitialFailureMechanismResultProbabilityFunc == null)
            {
                throw new ArgumentNullException(nameof(calculateInitialFailureMechanismResultProbabilityFunc));
            }

            if (failureMechanismSectionResultRowErrorProvider == null)
            {
                throw new ArgumentNullException(nameof(failureMechanismSectionResultRowErrorProvider));
            }

            if (performAssemblyFunc == null)
            {
                throw new ArgumentNullException(nameof(performAssemblyFunc));
            }

            if (constructionProperties == null)
            {
                throw new ArgumentNullException(nameof(constructionProperties));
            }

            this.calculateInitialFailureMechanismResultProbabilityFunc = calculateInitialFailureMechanismResultProbabilityFunc;
            this.failureMechanismSectionResultRowErrorProvider         = failureMechanismSectionResultRowErrorProvider;
            this.performAssemblyFunc = performAssemblyFunc;

            initialFailureMechanismResultTypeIndex = constructionProperties.InitialFailureMechanismResultTypeIndex;
            initialFailureMechanismResultSectionProbabilityIndex = constructionProperties.InitialFailureMechanismResultSectionProbabilityIndex;
            furtherAnalysisTypeIndex       = constructionProperties.FurtherAnalysisTypeIndex;
            refinedSectionProbabilityIndex = constructionProperties.RefinedSectionProbabilityIndex;
            sectionProbabilityIndex        = constructionProperties.SectionProbabilityIndex;
            assemblyGroupIndex             = constructionProperties.AssemblyGroupIndex;

            CreateColumnStateDefinitions();

            Update();
        }