public void populate(Round oldRound)
        {
            Round myRound = oldRound;

            //set the duration
            int minutes = (int) myRound.getDuration().Minutes;
            int seconds = (int) myRound.getDuration().Seconds;
            originalDuration = new TimeSpan(0, minutes, seconds);
            currentDuration = originalDuration;

            //set the roles
            roles = myRound.Roles;

            //set the questions
            questions = myRound.Questions;
        }
示例#2
0
        private Round loadRounderObject()
        {
            Round myRound = new Round(); //round object

            //roles
            List<string> roles = new List<string>();
            for (int i = 0; i < lstRoles.Items.Count; i++)
            {
                roles.Add(lstRoles.Items[i].ToString());
            }

            //questions
            List<string> questions = new List<string>();
            string _questions = txtQuestions.Text;
            char[] delimiters = new char[] { '\r', '\n' };
            string[] parts = _questions.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < parts.Length; i++)
            {
                myRound.Questions.Add(parts[i]);
            }

            //duration
            int minutes;
            int.TryParse(txtMinutes.Text, out minutes);
            int seconds;
            int.TryParse(txtSeconds.Text, out seconds);

            //set properties for Round object
            myRound.setDuration(minutes, seconds);
            myRound.Questions = questions;
            myRound.Roles = roles;

            return myRound;
        }