Exemplo n.º 1
0
        public void Compile()
        {
            var result = _view?.Compile();

            if (null == result) // compilation must be handled by this controller
            {
                InternalCompiling();
            }
            else // Compilation was handled by the view
            {
                _tempDoc.ScriptText = result.ScriptText(0);
                if (result is IScriptCompilerSuccessfulResult succResult)
                {
                    _compiledDoc = _tempDoc.CloneForModification();
                    _compiledDoc.SetCompilerResult(result);
                }
                else // not successful
                {
                    _compiledDoc = null;
                }
            }
        }