using System; using System.Diagnostics; using NaGet.Tasks; namespace NaGet.SubCommands.SubTask { /// /// 関数をサブタスク化 /// public class FunctionalSubTask : NaGetSubTask { private Action func = null; private object arg = null; /// /// コンストラクタ /// /// 関数 /// 関数への引数 public FunctionalSubTask(Action func, object arg) { this.func = func; this.arg = arg; } public override void Run() { NotifyStarted(); try { func(arg); } finally { NotifyCompleted(); } } /// /// 進捗は提供しない。 /// public override bool UseProgress { get { return false; } } } }