コード例 #1
0
        /// <summary>
        /// Adds an &lt;OnError /&gt; element to the current target.
        /// </summary>
        /// <param name="executeTargets">The targets to execute if a task fails. Separate multiple targets with semicolons. Multiple targets are executed in the order specified.</param>
        /// <param name="condition">Condition to be evaluated.</param>
        /// <param name="label">An optional label to add.</param>
        /// <returns>The current <see cref="ProjectCreator"/>.</returns>
        public ProjectCreator TargetOnError(string executeTargets, string condition = null, string label = null)
        {
            ProjectOnErrorElement onErrorElement = RootElement.CreateOnErrorElement(executeTargets);

            LastTarget.AppendChild(onErrorElement);

            onErrorElement.Condition = condition;
            onErrorElement.Label     = label;

            return(this);
        }