Example #1
0
        /// <summary>
        /// Batch loads a set of scripts of the same language
        /// </summary>
        /// <param name="filenames">The list of script filenames to load</param>
        private void LoadScriptBatch(string[] filenames)
        {
            if (filenames.Length <= 0)
            {
                return;
            }
            var errors = LocalLoader.LoadScripts(filenames, References);

            if (errors.Count <= 0)
            {
                return;
            }

            // If there are compiler errors record them and the file they occurred in
            foreach (string error in errors)
            {
                compilerErrors.Add(error);
            }
            if (!ignoreErrors)
            {
                var aggregateErrorText = new StringBuilder();
                foreach (string error in errors)
                {
                    aggregateErrorText.Append(error + "\r\n");
                }
                throw new InvalidOperationException("\r\nCompiler error(s) have occurred:\r\n\r\n " + aggregateErrorText + "\r\n");
            }
        }