예제 #1
0
 public string LevelName(Level level)
 {
     return GetLocalizedString(LocalizedStrings.LevelName, level.Name);
 }
예제 #2
0
파일: StaticCourse.cs 프로젝트: apsun/EzGPA
        /// <summary>
        /// Constructs a new course object.
        /// </summary>
        /// <param name="name">The name of the course.</param>
        /// <param name="credits">The credit value of the course.</param>
        /// <param name="groups">An array containing the level groups of the course.</param>
        /// <param name="scoreTable">The table that maps scores to GPA values.</param>
        public StaticCourse(string name, double credits, LevelGroup[] groups, ScoreTable scoreTable)
        {
            if (name == null)
                throw new ArgumentNullException("name");
            if (credits <= 0)
                throw new ArgumentOutOfRangeException("credits");
            if (groups == null)
                throw new ArgumentNullException("groups");
            if (groups.Length == 0)
                throw new ArgumentException("Must provide at least one level group");
            if (scoreTable == null)
                throw new ArgumentNullException("scoreTable");
            _name = name;
            _credits = credits;
            _groups = groups;
            _scoreTable = scoreTable;

            LevelGroup group = groups[0];
            _selectedLevelGroup = group;
            _selectedLevel = group.LevelCount > 0 ? group[0] : null;

            NameTranslator = x => x;
        }