Exemplo n.º 1
0
        /// <summary>
        /// Executes the block using the given <see cref="Runner"/>
        /// </summary>
        /// <param name="runner">The <see cref="Runner"/> that will be used to run the code</param>
        /// <returns>Whether the <see cref="InputText"/> is complete</returns>
        public bool Run(Runner runner)
        {
            //
            // Run the code and track errors
            //
            Errors.Clear();
            var complete = runner.Run(InputText, msg => {
                Errors.Add(msg);
            });
            OnPropertyChanged("HasErrors");

            //
            // Set the output
            //
            if (runner.HasResult) {
                OutputValue = runner.Result;
            }
            else {
                OutputValue = null;
                _hasOutput = false;
                OnPropertyChanged("HasOutput");
            }

            return complete;
        }