diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-08-01 03:14:38 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-08-01 03:14:38 -0700 |
| commit | c7d69b36789b6403f5b02a975afad80f6b23b48b (patch) | |
| tree | 6ef69db059c0c7f0ffc4c9b41f59759581360bfe /src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs | |
| parent | 63ebed98f610c9f6ae722d6a12678593c262ba3e (diff) | |
| download | wix-c7d69b36789b6403f5b02a975afad80f6b23b48b.tar.gz wix-c7d69b36789b6403f5b02a975afad80f6b23b48b.tar.bz2 wix-c7d69b36789b6403f5b02a975afad80f6b23b48b.zip | |
Refactor and remove code from WixToolset.BuildTask
Diffstat (limited to 'src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs')
| -rw-r--r-- | src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs index 84816cac..3441bd85 100644 --- a/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs +++ b/src/WixToolset.BuildTasks/CreateItemAvoidingInference.cs | |||
| @@ -3,11 +3,7 @@ | |||
| 3 | namespace WixToolset.BuildTasks | 3 | namespace WixToolset.BuildTasks |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.Collections; | ||
| 7 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 8 | using System.Globalization; | ||
| 9 | using System.IO; | ||
| 10 | using System.Xml; | ||
| 11 | using Microsoft.Build.Framework; | 7 | using Microsoft.Build.Framework; |
| 12 | using Microsoft.Build.Utilities; | 8 | using Microsoft.Build.Utilities; |
| 13 | 9 | ||
| @@ -17,27 +13,17 @@ namespace WixToolset.BuildTasks | |||
| 17 | /// </summary> | 13 | /// </summary> |
| 18 | public class CreateItemAvoidingInference : Task | 14 | public class CreateItemAvoidingInference : Task |
| 19 | { | 15 | { |
| 20 | private string inputProperties; | ||
| 21 | private ITaskItem[] outputItems; | ||
| 22 | |||
| 23 | /// <summary> | 16 | /// <summary> |
| 24 | /// The output items. | 17 | /// The properties to converty to items. |
| 25 | /// </summary> | 18 | /// </summary> |
| 26 | [Output] | 19 | [Required] |
| 27 | public ITaskItem[] OuputItems | 20 | public string InputProperties { get; set; } |
| 28 | { | ||
| 29 | get { return this.outputItems; } | ||
| 30 | } | ||
| 31 | 21 | ||
| 32 | /// <summary> | 22 | /// <summary> |
| 33 | /// The properties to converty to items. | 23 | /// The output items. |
| 34 | /// </summary> | 24 | /// </summary> |
| 35 | [Required] | 25 | [Output] |
| 36 | public string InputProperties | 26 | public ITaskItem[] OuputItems { get; private set; } |
| 37 | { | ||
| 38 | get { return this.inputProperties; } | ||
| 39 | set { this.inputProperties = value; } | ||
| 40 | } | ||
| 41 | 27 | ||
| 42 | /// <summary> | 28 | /// <summary> |
| 43 | /// Gets a complete list of external cabs referenced by the given installer database file. | 29 | /// Gets a complete list of external cabs referenced by the given installer database file. |
| @@ -45,14 +31,14 @@ namespace WixToolset.BuildTasks | |||
| 45 | /// <returns>True upon completion of the task execution.</returns> | 31 | /// <returns>True upon completion of the task execution.</returns> |
| 46 | public override bool Execute() | 32 | public override bool Execute() |
| 47 | { | 33 | { |
| 48 | List<ITaskItem> newItems = new List<ITaskItem>(); | 34 | var newItems = new List<ITaskItem>(); |
| 49 | 35 | ||
| 50 | foreach (string property in this.inputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) | 36 | foreach (var property in this.InputProperties.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) |
| 51 | { | 37 | { |
| 52 | newItems.Add(new TaskItem(property)); | 38 | newItems.Add(new TaskItem(property)); |
| 53 | } | 39 | } |
| 54 | 40 | ||
| 55 | this.outputItems = newItems.ToArray(); | 41 | this.OuputItems = newItems.ToArray(); |
| 56 | 42 | ||
| 57 | return true; | 43 | return true; |
| 58 | } | 44 | } |
