using System;
using System.ComponentModel;
using Ringtoets.AssemblyTool.Data;
namespace Ringtoets.Integration.Data.Assembly
{
///
/// The cpnverter that
/// to .
///
public static class ManualFailureMechanismSectionAssemblyCategoryGroupConverter
{
///
/// Converts a into a
/// .
///
/// The to convert.
/// The based on .
/// Thrown when is an invalid value.
/// Thrown when is a valid value, but not supported.
public static FailureMechanismSectionAssemblyCategoryGroup Convert(ManualFailureMechanismSectionAssemblyCategoryGroup categoryGroup)
{
if (!Enum.IsDefined(typeof(ManualFailureMechanismSectionAssemblyCategoryGroup), categoryGroup))
{
throw new InvalidEnumArgumentException(nameof(categoryGroup),
(int) categoryGroup,
typeof(ManualFailureMechanismSectionAssemblyCategoryGroup));
}
switch (categoryGroup)
{
case ManualFailureMechanismSectionAssemblyCategoryGroup.None:
return FailureMechanismSectionAssemblyCategoryGroup.None;
case ManualFailureMechanismSectionAssemblyCategoryGroup.NotApplicable:
return FailureMechanismSectionAssemblyCategoryGroup.NotApplicable;
case ManualFailureMechanismSectionAssemblyCategoryGroup.Iv:
return FailureMechanismSectionAssemblyCategoryGroup.Iv;
case ManualFailureMechanismSectionAssemblyCategoryGroup.IIv:
return FailureMechanismSectionAssemblyCategoryGroup.IIv;
case ManualFailureMechanismSectionAssemblyCategoryGroup.Vv:
return FailureMechanismSectionAssemblyCategoryGroup.Vv;
case ManualFailureMechanismSectionAssemblyCategoryGroup.VIIv:
return FailureMechanismSectionAssemblyCategoryGroup.VIIv;
default:
throw new NotSupportedException();
}
}
}
}