示例#1
0
        /// <summary>
        /// Builds all the content files which have been added to the project,
        /// dynamically creating .xnb files in the OutputDirectory.
        /// Returns an error message if the build fails.
        /// </summary>
        public string Build()
        {
            // Clear any previous errors.
            errorLogger.Errors.Clear();
            MyCustomBuildLogger logger = new MyCustomBuildLogger();

            logger.EventRaised += new Action <string>(logger_EventRaised);
            msBuildProject.ParentEngine.RegisterLogger(logger);
            // Build the project.
            if (!msBuildProject.Build())
            {
                // If the build failed, return an error string.
                return(string.Join("\n", errorLogger.Errors.ToArray()));
            }

            return(null);
        }
示例#2
0
        /// <summary>
        /// Builds all the content files which have been added to the project,
        /// dynamically creating .xnb files in the OutputDirectory.
        /// Returns an error message if the build fails.
        /// </summary>
        public string Build()
        {
            
            // Clear any previous errors.
            errorLogger.Errors.Clear();
            MyCustomBuildLogger logger=new MyCustomBuildLogger();
            logger.EventRaised+=new Action<string>(logger_EventRaised);
            msBuildProject.ParentEngine.RegisterLogger(logger);
            // Build the project.
            if (!msBuildProject.Build())
            {
                // If the build failed, return an error string.
                return string.Join("\n", errorLogger.Errors.ToArray());
            }

            return null;
        }