/// <summary>
        /// 将给定的 ContestParticipationMode 枚举值转换为对应的字符串。
        /// </summary>
        /// <param name="value">要转换的枚举值。</param>
        /// <returns>对应的字符串表示。</returns>
        /// <exception cref="ArgumentException"/>
        public static string ConvertToString(ContestParticipationMode value)
        {
            switch (value)
            {
            case ContestParticipationMode.IndividualOnly:
                return(IndividualOnlyString);

            case ContestParticipationMode.TeamworkOnly:
                return(TeamworkOnlyString);

            case ContestParticipationMode.Both:
                return(BothString);

            default:
                throw new ArgumentException("传入的 ContestParticipationMode 枚举值不合法。");
            }
        }
예제 #2
0
 public ContestConfigurationModel()
 {
     Authorization     = new ContestAuthorizationModel();
     ParticipationMode = ContestParticipationMode.Individual;
 }