Exemplo n.º 1
0
        public static void Main()
        {
            var dirInfo = new DirectoryInfo(@"..\..\..\..\AIML\Publishing");
            var data    = EditorModelIO.ReadGlobalData(dirInfo);
            var model   = new PublishViewModel(data.TopicsRoot, data.VideoData);
            var wnd     = new PublishPanel();

            wnd.DataContext = model;
            new Application().Run(wnd);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var directory = new DirectoryInfo(args[0]);
            var slides    = directory.CreateSubdirectory("LaTeXCompiledSlides");

            slides.Delete(true);
            slides.Create();

            var latexDirectory = directory.CreateSubdirectory("LaTeX");
            var files          = latexDirectory.GetFiles("L*.tex");
            var galleries      = new List <GalleryInfo>();
            var processor      = new LatexProcessor();

            foreach (var file in files)
            {
                var doc  = processor.Parse(file);
                var docs = doc.Sections.Select(z => new LatexDocument {
                    Preamble = doc.Preamble, Sections = new List <LatexSection> {
                        z
                    }
                }).ToList();
                int number = 0;
                foreach (var e in docs)
                {
                    var pdf             = processor.Compile(e, latexDirectory);
                    var targetDirectory = slides.CreateSubdirectory(file.Name + "." + number);
                    processor.ConvertToPng(pdf, targetDirectory);
                    galleries.Add(new GalleryInfo {
                        Name = e.LastSection.Name, Directory = targetDirectory
                    });
                    number++;
                }
            }

            var matcher =
                Matchers.ByName <VideoItem, GalleryInfo>(galleries, z => z.Name, (a, b) => a.Directory.FullName == b.Directory.FullName);

            var model = EditorModelIO.ReadGlobalData(directory);
            var root  = ItemTreeBuilder.Build <FolderItem, LectureItem, VideoItem>(model);

            matcher.Push(root);
            DataBinding <VideoItem> .SaveLayer <GalleryInfo>(root, directory);
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            var currentDirectoryName = EditorModelIO.SubstituteDebugDirectories(args[0]);

            currentDirectory = new DirectoryInfo(currentDirectoryName);

            var oldFormatFile = new FileInfo(Path.Combine(currentDirectory.FullName, "project.tuto"));
            var newFormatFile = new FileInfo(Path.Combine(currentDirectory.FullName, GlobalData.VideoListName));

            if (oldFormatFile.Exists && !newFormatFile.Exists)
            {
                var globalData = EditorModelIO.ReadGlobalData(currentDirectory);
                var structure  = Convert(globalData);
                structure.Save();
            }


            Application = new System.Windows.Application();
            var model  = new MainViewModel(currentDirectory, () => SourcesFactory());
            var window = new MainWindow();

            window.DataContext = model;
            Application.Run(window);
        }