/// <summary> /// Creates an unparented ProjectOutputElement, wrapping an unparented XmlElement. /// Validates the parameters. /// Exactly one of item name and property name must have a value. /// Caller should then ensure the element is added to a parent /// </summary> internal static ProjectOutputElement CreateDisconnected(string taskParameter, string itemType, string propertyName, ProjectRootElement containingProject) { ErrorUtilities.VerifyThrowArgument ( (String.IsNullOrEmpty(itemType) ^ String.IsNullOrEmpty(propertyName)), "OM_EitherAttributeButNotBoth", XMakeElements.output, XMakeAttributes.propertyName, XMakeAttributes.itemName ); XmlElementWithLocation element = containingProject.CreateElement(XMakeElements.output); ProjectOutputElement output = new ProjectOutputElement(element, containingProject); output.TaskParameter = taskParameter; if (!String.IsNullOrEmpty(itemType)) { output.ItemType = itemType; } else { output.PropertyName = propertyName; } return(output); }
/// <summary> /// Parse a ProjectTaskElement /// </summary> private ProjectTaskElement ParseProjectTaskElement(XmlElementWithLocation element, ProjectTargetElement parent) { foreach (XmlAttributeWithLocation attribute in element.Attributes) { ProjectErrorUtilities.VerifyThrowInvalidProject ( !XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(attribute.Name), attribute.Location, "BadlyCasedSpecialTaskAttribute", attribute.Name, element.Name, element.Name ); } ProjectTaskElement task = new ProjectTaskElement(element, parent, _project); foreach (XmlElementWithLocation childElement in ProjectXmlUtilities.GetVerifyThrowProjectChildElements(element)) { ProjectErrorUtilities.VerifyThrowInvalidProject(childElement.Name == XMakeElements.output, childElement.Location, "UnrecognizedChildElement", childElement.Name, task.Name); ProjectOutputElement output = ParseProjectOutputElement(childElement, task); task.AppendParentedChildNoChecks(output); } return(task); }
public ProjectOutputElement AddOutputItem (string taskParameter, string itemType, string condition) { var output = new ProjectOutputElement (taskParameter, itemType, null, ContainingProject); if( condition != null) output.Condition = condition; AppendChild (output); return output; }
public ProjectOutputElement AddOutputProperty (string taskParameter, string propertyName, string condition) { var output = new ProjectOutputElement (taskParameter, null, propertyName, ContainingProject); if( condition != null) output.Condition = condition; AppendChild (output); return output; }
internal ProjectTaskOutputItemInstance (ProjectOutputElement xml) { condition = xml.Condition; ItemType = xml.ItemType; TaskParameter = xml.TaskParameter; condition_location = xml.ConditionLocation; location = xml.Location; task_parameter_location = xml.TaskParameterLocation; }
internal ProjectTaskOutputPropertyInstance (ProjectOutputElement xml) { condition = xml.Condition; PropertyName = xml.PropertyName; TaskParameter = xml.TaskParameter; condition_location = xml.ConditionLocation; location = xml.Location; task_parameter_location = xml.TaskParameterLocation; }
public ProjectOutputElement AddOutputItem(string taskParameter, string itemType, string condition) { var output = new ProjectOutputElement(taskParameter, itemType, null, ContainingProject); if (condition != null) { output.Condition = condition; } AppendChild(output); return(output); }
public ProjectOutputElement AddOutputProperty(string taskParameter, string propertyName, string condition) { var output = new ProjectOutputElement(taskParameter, null, propertyName, ContainingProject); if (condition != null) { output.Condition = condition; } AppendChild(output); return(output); }
/// <summary> /// Convenience method to add a conditioned Output Property to this task. /// Adds after the last child. /// </summary> public ProjectOutputElement AddOutputProperty(string taskParameter, string propertyName, string condition) { ProjectOutputElement outputProperty = ContainingProject.CreateOutputElement(taskParameter, null, propertyName); if (condition != null) { outputProperty.Condition = condition; } AppendChild(outputProperty); return(outputProperty); }
/// <summary> /// Convenience method to add a conditioned Output Item to this task. /// Adds after the last child. /// </summary> public ProjectOutputElement AddOutputItem(string taskParameter, string itemType, string condition) { ProjectOutputElement outputItem = ContainingProject.CreateOutputElement(taskParameter, itemType, null); if (condition != null) { outputItem.Condition = condition; } AppendChild(outputItem); return(outputItem); }
/// <summary> /// Creates an unparented ProjectOutputElement, wrapping an unparented XmlElement. /// Validates the parameters. /// Exactly one of item name and property name must have a value. /// Caller should then ensure the element is added to a parent /// </summary> internal static ProjectOutputElement CreateDisconnected(string taskParameter, string itemType, string propertyName, ProjectRootElement containingProject) { ErrorUtilities.VerifyThrowArgument ( (String.IsNullOrEmpty(itemType) ^ String.IsNullOrEmpty(propertyName)), "OM_EitherAttributeButNotBoth", XMakeElements.output, XMakeAttributes.propertyName, XMakeAttributes.itemName ); XmlElementWithLocation element = containingProject.CreateElement(XMakeElements.output); ProjectOutputElement output = new ProjectOutputElement(element, containingProject); output.TaskParameter = taskParameter; if (!String.IsNullOrEmpty(itemType)) { output.ItemType = itemType; } else { output.PropertyName = propertyName; } return output; }