/// <summary> /// This constructor allows all output data to be initialized. /// </summary> /// <owner>SumedhK</owner> /// <param name="node">The XML element for the Output tag.</param> internal TaskOutput(XmlElement node) { ErrorUtilities.VerifyThrow(node != null, "Need the XML for the <Output> tag."); ProjectXmlUtilities.VerifyThrowProjectNoChildElements(node); int requiredData = 0; string taskName = node.ParentNode.Name; foreach (XmlAttribute outputAttribute in node.Attributes) { switch (outputAttribute.Name) { case XMakeAttributes.taskParameter: ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); ProjectErrorUtilities.VerifyThrowInvalidProject(!XMakeAttributes.IsSpecialTaskAttribute(outputAttribute.Value) && !XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(outputAttribute.Value), outputAttribute, "BadlyCasedSpecialTaskAttribute", outputAttribute.Value, taskName, taskName); this.taskParameterAttribute = outputAttribute; break; case XMakeAttributes.itemName: ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); this.itemNameAttribute = outputAttribute; requiredData++; break; case XMakeAttributes.propertyName: ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); ProjectErrorUtilities.VerifyThrowInvalidProject(!ReservedPropertyNames.IsReservedProperty(outputAttribute.Value), node, "CannotModifyReservedProperty", outputAttribute.Value); this.propertyNameAttribute = outputAttribute; requiredData++; break; case XMakeAttributes.condition: this.conditionAttribute = outputAttribute; break; default: ProjectXmlUtilities.ThrowProjectInvalidAttribute(outputAttribute); break; } } /* NOTE: * TaskParameter must be specified * either ItemName or PropertyName must be specified * if ItemName is specified, then PropertyName cannot be specified * if PropertyName is specified, then ItemName cannot be specified * only Condition is truly optional */ ProjectErrorUtilities.VerifyThrowInvalidProject((this.taskParameterAttribute != null) && (requiredData == 1), node, "InvalidTaskOutputSpecification", taskName); }