OSDN Git Service

AppliStation-All,インストール処理を新方式(NaGetInstall2)に変更。
[applistation/AppliStation.git] / na-get-lib / NaGet.SubCommands.SubTask / LocalUpdateSubTask.cs
1 using System;
2 using NaGet.Tasks;
3 using NaGet.Packages;
4
5 namespace NaGet.SubCommands.SubTask
6 {
7         public class LocalUpdateSubTask : NaGetSubTask
8         {
9                 private PackageListsManager pkgListMan;
10                 
11                 public LocalUpdateSubTask(PackageListsManager pkgListMan)
12                 {
13                         this.pkgListMan = pkgListMan;
14                 }
15                 
16                 public override void Run()
17                 {
18                         NotifyStarted();
19                         RaiseTaskSetEvent(TaskEventType.STARTED, "インストール済みファイルリスト更新", 0);
20                         
21                         pkgListMan.DetectInstalledPkgs();
22                         pkgListMan.SaveInstalledPackageList();
23                         RaiseTaskSetEvent(TaskEventType.INFO, string.Format("{0} を更新しました", NaGet.Env.ArchiveInstalledPackageListFile), 50);
24                         
25                         pkgListMan.DetectSystemInstalledPkgs();
26                         pkgListMan.SaveSystemInstalledPackageList();
27                         RaiseTaskSetEvent(TaskEventType.INFO, string.Format("{0} を更新しました", NaGet.Env.SystemInstalledPackageListFile), 100);
28                         
29                         RaiseTaskSetEvent(TaskEventType.COMPLETED, "インストール済みファイルリスト更新", 100);
30                         NotifyCompleted();
31                 }
32         }
33 }