Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of <see cref="SerializableAssessmentProcess"/>.
        /// </summary>
        /// <param name="id">The unique assembly ID.</param>
        /// <param name="assessmentSection">The assessment section this process belongs to.</param>
        /// <exception cref="ArgumentNullException">Thrown when any parameter except <paramref name="id"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="id"/> is invalid.</exception>
        public SerializableAssessmentProcess(string id,
                                             SerializableAssessmentSection assessmentSection) : this()
        {
            SerializableIdValidator.ThrowIfInvalid(id);

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

            Id = id;
            AssessmentSectionId = assessmentSection.Id;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of <see cref="SerializableAssembly"/>.
        /// </summary>
        /// <param name="id">The unique assembly ID.</param>
        /// <param name="lowerCorner">The lower corner of the assembly map boundary.</param>
        /// <param name="upperCorner">The upper corner of the assembly map boundary.</param>
        /// <param name="assessmentSection">The <see cref="SerializableAssessmentSection"/> that belongs to the assembly.</param>
        /// <param name="assessmentProcess">The <see cref="SerializableAssessmentProcess"/> that belongs to the assembly.</param>
        /// <param name="totalAssemblyResult">The <see cref="SerializableTotalAssemblyResult"/> that belongs to the assembly.</param>
        /// <param name="failureMechanisms">The collection of <see cref="SerializableFailureMechanism"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSectionAssemblies">The collection of <see cref="SerializableFailureMechanismSectionAssembly"/> that
        /// belong to the assembly.</param>
        /// <param name="combinedFailureMechanismSectionAssemblies">The collection of <see cref="SerializableCombinedFailureMechanismSectionAssembly"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSectionCollections">The collection of <see cref="SerializableFailureMechanismSectionCollection"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSections">The collection of <see cref="SerializableFailureMechanismSection"/> that
        /// belong to the assembly.</param>
        /// <exception cref="ArgumentNullException">Thrown when any parameter except <paramref name="id"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="id"/> is invalid.</exception>
        public SerializableAssembly(string id,
                                    Point2D lowerCorner,
                                    Point2D upperCorner,
                                    SerializableAssessmentSection assessmentSection,
                                    SerializableAssessmentProcess assessmentProcess,
                                    SerializableTotalAssemblyResult totalAssemblyResult,
                                    IEnumerable <SerializableFailureMechanism> failureMechanisms,
                                    IEnumerable <SerializableFailureMechanismSectionAssembly> failureMechanismSectionAssemblies,
                                    IEnumerable <SerializableCombinedFailureMechanismSectionAssembly> combinedFailureMechanismSectionAssemblies,
                                    IEnumerable <SerializableFailureMechanismSectionCollection> failureMechanismSectionCollections,
                                    IEnumerable <SerializableFailureMechanismSection> failureMechanismSections)
        {
            SerializableIdValidator.ThrowIfInvalid(id);

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

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

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

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

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

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

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

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

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

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

            Id       = id;
            Boundary = new SerializableBoundary(lowerCorner, upperCorner);

            var featureMembers = new List <SerializableFeatureMember>
            {
                assessmentSection,
                assessmentProcess,
                totalAssemblyResult
            };

            featureMembers.AddRange(failureMechanisms);
            featureMembers.AddRange(failureMechanismSectionAssemblies);
            featureMembers.AddRange(combinedFailureMechanismSectionAssemblies);
            featureMembers.AddRange(failureMechanismSectionCollections);
            featureMembers.AddRange(failureMechanismSections);
            FeatureMembers = featureMembers.ToArray();
        }