Esempio n. 1
0
            public ContextStackEntry(Texplate stack, ITexplateContext context)
            {
                this.stack   = stack;
                this.context = context;

                this.stack.contextStack.Push(this.context);
            }
Esempio n. 2
0
        public async Task <bool> Mux(Project project, IProgressReporter reporter)
        {
            var tTpl = new Texplate.Texplate();

            using (tTpl.EnterContext(this))
                using (tTpl.EnterContext(project))
                {
                    var tXmlDir = project.XmlTempDir;

                    var tClipDescFile = tXmlDir.PickFile(ClipDescFile);
                    using (var tClipDescWriter = tClipDescFile.CreateText())
                    {
                        var tRenderer = this[ClipDesc];
                        tClipDescWriter.Write(tRenderer.Render(tTpl));
                    }

                    var tProjDefFile = tXmlDir.PickFile(ProjDefFile);
                    using (tTpl.EnterContext(new ClipDescFileContext(tClipDescFile)))
                        using (var tProjDefWriter = tProjDefFile.CreateText())
                        {
                            var tRenderer = this[ProjDef];
                            tProjDefWriter.Write(tRenderer.Render(tTpl));
                        }

                    MuxEnqueueStruct tMuxTaskDef = new MuxEnqueueStruct(tProjDefFile.FullName, project.ClipCount);
                    var tMuxTask = muxService.Enqueue(tMuxTaskDef);

                    return(await Task.Run(() => WaitMuxTask(tMuxTask, reporter)));
                }
        }