From 7b089da2a1af67c734c69a859d9ac61d2c21d550 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Fri, 26 Dec 2014 00:05:33 -0500 Subject: [PATCH] Begin to implement Convert project task action --- .../ProjectTaskActionConvert.cs | 77 +++++++++++++++++++ .../UniversalEditor.Essential.csproj | 3 + 2 files changed, 80 insertions(+) create mode 100644 CSharp/Plugins/UniversalEditor.Essential/ProjectTaskActions/ProjectTaskActionConvert.cs diff --git a/CSharp/Plugins/UniversalEditor.Essential/ProjectTaskActions/ProjectTaskActionConvert.cs b/CSharp/Plugins/UniversalEditor.Essential/ProjectTaskActions/ProjectTaskActionConvert.cs new file mode 100644 index 00000000..2f484619 --- /dev/null +++ b/CSharp/Plugins/UniversalEditor.Essential/ProjectTaskActions/ProjectTaskActionConvert.cs @@ -0,0 +1,77 @@ +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'"); + + + } + } + } +} diff --git a/CSharp/Plugins/UniversalEditor.Essential/UniversalEditor.Essential.csproj b/CSharp/Plugins/UniversalEditor.Essential/UniversalEditor.Essential.csproj index de87e9c9..5ad6db9a 100644 --- a/CSharp/Plugins/UniversalEditor.Essential/UniversalEditor.Essential.csproj +++ b/CSharp/Plugins/UniversalEditor.Essential/UniversalEditor.Essential.csproj @@ -112,6 +112,9 @@ + + Code +