Files
linux-packaging-mono/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/Task.cs
Xamarin Public Jenkins d444f0caa4 Imported Upstream version 4.4.0.122
Former-commit-id: a99f46acaeba3ab496c7afc02c29b839e30a0d0b
2016-04-12 13:19:31 -04:00

110 lines
2.5 KiB
C#

//
// Task.cs: Represents a task.
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Resources;
using Microsoft.Build.Framework;
namespace Microsoft.Build.Utilities
{
public abstract class Task : ITask
{
IBuildEngine buildEngine;
string helpKeywordPrefix;
ITaskHost hostObject;
TaskLoggingHelper log;
protected Task()
: this (null, null)
{
}
protected Task(ResourceManager taskResources)
: this (taskResources, null)
{
}
protected Task(ResourceManager taskResources,
string helpKeywordPrefix)
{
log = new TaskLoggingHelper (this);
log.TaskResources = taskResources;
this.helpKeywordPrefix = helpKeywordPrefix;
}
public abstract bool Execute();
public IBuildEngine BuildEngine {
get {
return buildEngine;
}
set {
buildEngine = value;
}
}
public IBuildEngine2 BuildEngine2 {
get { return buildEngine as IBuildEngine2; }
}
protected string HelpKeywordPrefix {
get {
return helpKeywordPrefix;
}
set {
helpKeywordPrefix = value;
}
}
public ITaskHost HostObject {
get {
return hostObject;
}
set {
hostObject = value;
}
}
public TaskLoggingHelper Log {
get {
return log;
}
}
protected ResourceManager TaskResources {
get {
return log.TaskResources;
}
set {
log.TaskResources = value;
}
}
}
}