Пример #1
0
        public XSLTItemsFactory(Course _course)
        {
            if (_course == null)
                throw new ArgumentNullException("Не задан курс для создания элементов");

            string pathTools = System.IO.Path.Combine(_course.rootDirectory.AsPath()
                                                        , _course.pathDirectory.AsPath()
                                                        , _course.attributes.toolsList.directory.AsPath());
            tlFactory = new ToolsFactory(_course.attributes.toolsList, pathTools);
        }
Пример #2
0
        /// <summary>
        /// класс темы для конвертации
        /// xslt 
        /// </summary>
        /// <param name="_item">тема курса</param>
        /// <param name="_tlFactory">фабрика инструментов</param>
        /// <exception cref="ArgumentNullException"></exception>
        public ItemThemeForXSLT(LearningItem _item,ToolsFactory _tlFactory )
        {
            if (_item == null || _tlFactory==null)
                throw new ArgumentNullException();

            item = _item;
            if (item.childs == null)
                throw new ArgumentNullException("Отсутствуют кадры в теме "+item.identifier);

            number++;
            IdInTheme = number;

            FileName = "theme" + IdInTheme;
            initSteps(_tlFactory);
        }
Пример #3
0
 /// <summary>
 /// инициализировать кадры
 /// темы
 /// </summary>
 private void initSteps(ToolsFactory _tlFactory)
 {
     try
     {
         string pathTheme = System.IO.Path.Combine(item.rootDirectory.AsPath()
                                                 , item.pathDirectory.AsPath());
         steps = new ObservableCollection<ISubItemForXSLT>();
         ItemStepModel tmpStep = null;
         string path = pathTheme.AsPath();
         ItemStepForXSLT.ResetIdInStep();
         foreach (LearningStep ls in item.learningSteps)
         {
             tmpStep = new ItemStepModel(ls, path);
             tmpStep.InitTools(_tlFactory);
             steps.Add(new ItemStepForXSLT(tmpStep));
         }
     }
     catch (ArgumentNullException)
     {
         throw new Exception("Отсутствуют кадры темы: " + item.identifier);
     }
     catch
     {
         //throw new Exception("Невозможно создать коллекцию кадров темы: " + item.identifier);
     }
 }