OSDN Git Service

AppliStation-all,Copyright年を2017年に更新
[applistation/AppliStation.git] / na-get-lib / NaGet.Tasks / TaskEventArgs.cs
1 using System;
2
3 namespace NaGet.Tasks
4 {
5         /// <summary>
6         /// タスクイベントの種類
7         /// </summary>
8         public enum TaskEventType
9         {
10                 /// <summary>
11                 /// 動作進捗・通知のみ
12                 /// </summary>
13                 PING,
14                 /// <summary>
15                 /// 開始
16                 /// </summary>
17                 STARTED,
18                 /// <summary>
19                 /// 完了した(すべてを完了)
20                 /// </summary>
21                 COMPLETED,
22                 /// <summary>
23                 /// 作業がキャンセルされた
24                 /// </summary>
25                 CANCELED,
26                 /// <summary>
27                 /// エラーを発生し(中断した)
28                 /// </summary>
29                 ERROR,
30                 /// <summary>
31                 /// エラーが発生したが継続
32                 /// </summary>
33                 WARNING,
34                 /// <summary>
35                 /// そのほかの情報
36                 /// </summary>
37                 INFO,
38                 /// <summary>
39                 /// 子作業を開始
40                 /// </summary>
41                 STARTED_SUBTASK,
42                 /// <summary>
43                 /// 子作業を終了
44                 /// </summary>
45                 COMPLETED_SUBTASK,
46         }
47         
48         /// <summary>
49         /// タスクのイベント
50         /// </summary>
51         public class TaskEventArgs : EventArgs
52         {
53                 /// <summary>
54                 /// タスクイベントの種類
55                 /// </summary>
56                 public TaskEventType Type = TaskEventType.PING;
57                 
58                 /// <summary>
59                 /// タスクの進捗状況の百分率表示
60                 /// </summary>
61                 public float ProgressPercent = -1;
62                 
63                 /// <summary>
64                 /// タスクの現況のメッセージ
65                 /// </summary>
66                 public string TaskMessage;
67                 
68                 /// <summary>
69                 /// コンストラクタ
70                 /// </summary>
71                 public TaskEventArgs()
72                         : this(TaskEventType.PING, null, -1)
73                 {
74                 }
75                 
76                 /// <summary>
77                 /// コンストラクタ
78                 /// </summary>
79                 public TaskEventArgs(TaskEventType type, string message, float percent)
80                 {
81                         this.Type = type;
82                         this.TaskMessage = message;
83                         this.ProgressPercent = percent;
84                 }
85         }
86 }