Ejemplo n.º 1
0
        /// <summary>
        /// Создание экзепляра типа по XmlNode.
        /// </summary>
        /// <param name="xmlNode"></param>
        /// <returns></returns>
        public static ExerciseType CreateFromXml(XmlNode xmlNode)
        {
            ExerciseType result = new ExerciseType();
            XmlAttribute attr;

            attr = xmlNode.Attributes[xmlFieldTrainType];

            if (attr != null && !string.IsNullOrEmpty(attr.Value))
            {
                TrainType baseType = (TrainType)Enum.Parse(typeof(TrainType), attr.Value);

                switch (baseType)
                {
                case TrainType.Date:
                    result = new ExerciseTypeDate();
                    break;

                case TrainType.NumericAlphabet:
                    result = new ExerciseTypeNumericAlphaget();
                    break;

                case TrainType.Impression:
                    result = new ExerciseTypeImpression();
                    break;

                case TrainType.Calculate:
                    result = new ExerciseTypeCalculate();
                    break;

                case TrainType.RecentMemory:
                    result = new ExerciseTypeStepanovAndRecentMemory(TrainType.RecentMemory);
                    break;

                case TrainType.Stepanov:
                    result = new ExerciseTypeStepanovAndRecentMemory(TrainType.Stepanov);
                    break;

                case TrainType.NumberGenerator:
                    result = new ExerciseTypeNumberGenerator();
                    break;

                case TrainType.SecondArrowAttention:
                    result = new ExerciseTypeSecondArrowAttention();
                    break;

                case TrainType.Strup:
                    result = new ExerciseTypeStrup();
                    break;

                case TrainType.NetTrain:
                    result = new ExerciseTypeNetTrain();
                    break;

                case TrainType.InterruptionReading:
                    result = new ExerciseTypeInterruptionReading();
                    break;

                default:
                    result = new ExerciseType(baseType);
                    break;
                }

                result.LoadTypeAttributes(xmlNode);
            }

            return(result);
        }
Ejemplo n.º 2
0
 public ExerciseSerie(ExerciseType type)
 {
     this.type = type;
 }