Exemplo n.º 1
0
        public static DoorsNum Parse(string i_DoorsNumAsStr)
        {
            eDoorsNum doorsNumToSet = eDoorsNum.Two;

            if (i_DoorsNumAsStr == "3" || i_DoorsNumAsStr == "three" || i_DoorsNumAsStr == "Three" || i_DoorsNumAsStr == "THREE")
            {
                doorsNumToSet = eDoorsNum.Three;
            }
            else if (i_DoorsNumAsStr == "4" || i_DoorsNumAsStr == "four" || i_DoorsNumAsStr == "Four" || i_DoorsNumAsStr == "FOUR")
            {
                doorsNumToSet = eDoorsNum.Four;
            }
            else if (i_DoorsNumAsStr == "5" || i_DoorsNumAsStr == "five" || i_DoorsNumAsStr == "Five" || i_DoorsNumAsStr == "FIVE")
            {
                doorsNumToSet = eDoorsNum.Five;
            }
            else if (i_DoorsNumAsStr != "2" && i_DoorsNumAsStr != "two" && i_DoorsNumAsStr != "Two" && i_DoorsNumAsStr != "TWO")
            {
                throw new FormatException();
            }

            DoorsNum doorsNum = new DoorsNum();

            doorsNum.m_DoorsNum = doorsNumToSet;

            return(doorsNum);
        }
Exemplo n.º 2
0
 public override void SetSpecificProperties(string[] i_SpecificProperties)
 {
     m_Color    = Color.Parse(i_SpecificProperties[0]);
     m_DoorsNum = DoorsNum.Parse(i_SpecificProperties[1]);
 }