Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is ExerciseTypeStrup))
            {
                return(false);
            }

            ExerciseTypeStrup target = (ExerciseTypeStrup)obj;

            if (this.AutoShowingMode == target.AutoShowingMode)
            {
                if (this.AutoShowingMode)
                {
                    return(this.ShowTime == target.ShowTime);
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
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);
        }