コード例 #1
0
        /// <summary>
        /// Adds a &lt;UsingTask /&gt; that refers to an assembly by name.
        /// </summary>
        /// <param name="taskName">The name of the task.</param>
        /// <param name="assemblyName">The name of the assembly to load.</param>
        /// <param name="taskFactory">An optional class in the assembly that is responsible for generating instances of the specified Task name.</param>
        /// <param name="runtime">An optional runtime for the task.</param>
        /// <param name="architecture">An optional architecture for the task.</param>
        /// <param name="condition">An optional condition to add to the task.</param>
        /// <param name="label">An optional label to add to the task.</param>
        /// <returns>The current <see cref="ProjectCreator" />.</returns>
        public ProjectCreator UsingTaskAssemblyName(string taskName, string assemblyName, string taskFactory, string?runtime = null, string?architecture = null, string?condition = null, string?label = null)
        {
            _lastUsingTask = AddTopLevelElement(RootElement.CreateUsingTaskElement(taskName, null, assemblyName, runtime, architecture));

            _lastUsingTask.TaskFactory = taskFactory;
            _lastUsingTask.Condition   = condition;
            _lastUsingTask.Label       = label;

            return(this);
        }