From bc0907528f2d803db16c5decd3f094c32c37218c Mon Sep 17 00:00:00 2001 From: ttp Date: Sat, 16 Jul 2011 11:17:30 +0900 Subject: [PATCH] =?utf8?q?na-get-lib,=E3=82=82=E3=81=AF=E3=82=84=E4=BD=BF?= =?utf8?q?=E3=82=8F=E3=82=8C=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9FN?= =?utf8?q?aGetTaskSet=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=92=E5=89=8A?= =?utf8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- na-get-lib/NaGet.SubCommands/NaGetTaskSet.cs | 102 --------------------------- na-get-lib/na-get-lib.csproj | 1 - 2 files changed, 103 deletions(-) delete mode 100644 na-get-lib/NaGet.SubCommands/NaGetTaskSet.cs diff --git a/na-get-lib/NaGet.SubCommands/NaGetTaskSet.cs b/na-get-lib/NaGet.SubCommands/NaGetTaskSet.cs deleted file mode 100644 index 19adc73..0000000 --- a/na-get-lib/NaGet.SubCommands/NaGetTaskSet.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using NaGet.Tasks; - -namespace NaGet.SubCommands -{ - /// - /// NaGetƒ^ƒXƒNˆ—‚̃pƒbƒN - /// - [Obsolete] - public abstract class NaGetTaskSet : Task - { - /// - /// ƒ^ƒXƒNˆ—’†‚ÌŽ¿–â‚̃nƒ“ƒhƒ‰ - /// - public event NaGetTaskQueryHandler TaskQueryRaised; - - /// - /// •¶Žš—ñ‚Å•\Œ»‚µ‚½ì‹Æˆê——ƒŠƒXƒg - /// - protected IList taskSetNames; - - /// - /// •¶Žš—ñ‚Å•\Œ»‚µ‚½ì‹Æˆê——ƒŠƒXƒg - /// - public virtual IList TaskSetNames { - get { - return new ReadOnlyCollection(taskSetNames); - } - } - - /// - /// Œ»ÝŽÀs’†‚̍ì‹Æ”ԍ† - /// - public abstract int CurrentTaskSetIndex { - get; - } - - /// - /// Œ»Ý‚̐i’»‚ð–ß‚·B - /// - /// ì‹Æ‚̏ó‘Ô - /// ƒTƒuƒ^ƒXƒN‚̐i’» - /// Œ»Ý‚̐i’» - protected virtual float GetProgressPercent(TaskEventType type, float subTaskProgress) - { - if (CurrentTaskSetIndex >= 0) { - if (subTaskProgress >= 0) { - return (CurrentTaskSetIndex * 100 + subTaskProgress) / taskSetNames.Count; - } - switch (type) { - case TaskEventType.STARTED: - return 0; - case TaskEventType.COMPLETED: - return 100; - case TaskEventType.COMPLETED_SUBTASK: - return ((CurrentTaskSetIndex+1) * 100) / taskSetNames.Count; - default: - return (CurrentTaskSetIndex * 100) / taskSetNames.Count; - } - } - - return -1; - } - - #region TaskEvent•Ö—˜ƒƒ\ƒbƒh - - protected virtual void RaiseTaskSetEvent(TaskEventType type, string message) - { - RaiseTaskSetEvent(type, message, GetProgressPercent(type, -1)); - } - - protected virtual void ReceivedErrorData(object sender, NaGet.Utils.AnyDataEventArgs e) - { - if (! string.IsNullOrEmpty(e.Data)) { - RaiseTaskSetEvent(TaskEventType.WARNING, e.Data); - } - } - - protected virtual void ReceivedOutputData(object sender, NaGet.Utils.AnyDataEventArgs e) - { - if (! string.IsNullOrEmpty(e.Data)) { - RaiseTaskSetEvent(TaskEventType.INFO, e.Data); - } - } - - #endregion - - protected virtual NaGetTaskQueryResult RaiseTaskSetQueryEvent(string message, NaGetTaskQueryResult selection) - { - if (TaskQueryRaised != null) { - return TaskQueryRaised(this, new NaGetTaskQueryArgs(message, selection)); - } - return NaGetTaskQueryResult.CANCELED_AUTOMATICALLY; - } - - public override bool Running { - get { return CurrentTaskSetIndex >= 0 && !Done; } - } - } -} diff --git a/na-get-lib/na-get-lib.csproj b/na-get-lib/na-get-lib.csproj index 67eb063..00c9baf 100644 --- a/na-get-lib/na-get-lib.csproj +++ b/na-get-lib/na-get-lib.csproj @@ -77,7 +77,6 @@ - -- 2.11.0