using System; using System.Collections.Generic; using UniversalEditor.ObjectModels.Markup; using UniversalEditor.ObjectModels.Project; namespace UniversalEditor.ProjectTaskActions { /// /// Converts an from an input to an /// output . /// public class ProjectTaskActionConvert : ProjectTaskAction { private DataFormatReference mvarInputDataFormatReference = null; /// /// The that specifies a /// compatible with the of the specified /// . /// public DataFormatReference InputDataFormatReference { get { return mvarInputDataFormatReference; } set { mvarInputDataFormatReference = value; } } private DataFormatReference mvarOutputDataFormatReference = null; /// /// The that specifies a /// compatible with the of the specified /// . /// public DataFormatReference OutputDataFormatReference { get { return mvarOutputDataFormatReference; } set { mvarOutputDataFormatReference = value; } } private ProjectFile mvarProjectFile = null; /// /// The to be converted upon project build. /// public ProjectFile ProjectFile { get { return mvarProjectFile; } set { mvarProjectFile = value; } } private static ProjectTaskActionReference _ptar = null; protected override ProjectTaskActionReference MakeReferenceInternal() { if (_ptar == null) { _ptar = base.MakeReferenceInternal(); _ptar.ProjectTaskActionTypeID = new Guid("{0EB3C0A9-804A-433F-BDD8-888D0CA8C760}"); _ptar.ProjectTaskActionTypeName = "UniversalEditor.ProjectTaskActionConvert"; } return _ptar; } public override string Title { get { return "Convert: "; } } protected override void ExecuteInternal(ExpandedStringVariableStore variables) { } protected override void LoadFromMarkupInternal(MarkupTagElement tag) { MarkupTagElement tagInputDataFormatReference = (tag.Elements["InputDataFormatReference"] as MarkupTagElement); if (tagInputDataFormatReference != null) { MarkupAttribute attTypeName = tagInputDataFormatReference.Attributes["TypeName"]; MarkupAttribute attTypeID = tagInputDataFormatReference.Attributes["TypeID"]; if (attTypeName == null && attTypeID == null) throw new ArgumentNullException("Must specify at least one of 'TypeName' or 'TypeID'"); } MarkupTagElement tagOutputDataFormatReference = (tag.Elements["OutputDataFormatReference"] as MarkupTagElement); if (tagOutputDataFormatReference != null) { MarkupAttribute attTypeName = tagOutputDataFormatReference.Attributes["TypeName"]; MarkupAttribute attTypeID = tagOutputDataFormatReference.Attributes["TypeID"]; if (attTypeName == null && attTypeID == null) throw new ArgumentNullException("Must specify at least one of 'TypeName' or 'TypeID'"); } } } }