X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=blobdiff_plain;f=all-get%2FMain.cs;h=a4be97073ca05645eb7d4462f6b087bf3a1fb491;hp=d69d548898f652d03b1336b5ea68c6fdaa25a8e7;hb=4400961321739b1a12162e22619290477333a8e6;hpb=a406078aab09b3c7a9ad9b886e340e633251c16e diff --git a/all-get/Main.cs b/all-get/Main.cs index d69d548..a4be970 100644 --- a/all-get/Main.cs +++ b/all-get/Main.cs @@ -2,7 +2,6 @@ using System; using System.IO; using System.Collections.Generic; -using NaGet.Net; using NaGet.Packages; using NaGet.Packages.Install; using NaGet.SubCommands; @@ -10,59 +9,6 @@ using NaGet.Tasks; namespace AllGet { - - class DownloadListener - { - private string line = null; - - /// - /// lineのコンソール上における長さ - /// - private int lineWidth = 0; - - public void OnDownload(object sender, DownloadEventArgs a) { - if (line != null) { - lock (line) { - int newpos = (lineWidth <= 0)? 0 : Console.CursorLeft - lineWidth; - if (newpos < 0) newpos = 0; - - // 空白で埋める - Console.CursorLeft = newpos; - for (int i = 0; i < lineWidth && Console.CursorLeft < Console.BufferWidth; i++) { - Console.Write(' '); - } - Console.CursorLeft = newpos; - - line = null; lineWidth = 0; - } - } - - switch (a.DownloadTaskType) { - case DownloadEventType.INITED: - line = "starting..."; - break; - case DownloadEventType.CONNECTED: - case DownloadEventType.DOWNLOADING: - line = a.TaskMessage; - break; - case DownloadEventType.COMPLETED: - // - line = null; - break; - case DownloadEventType.ERROR: - Console.Write("interrupted! ERROR!"); - line = null; - break; - } - - if (line != null) { - int posOld = Console.CursorLeft; - Console.Write(line); - lineWidth = Console.CursorLeft - posOld; - } - } - } - sealed class TaskSetEventHandlers { public static void OnTaskSetEvent(object sender, TaskEventArgs e) { @@ -149,8 +95,6 @@ namespace AllGet class MainClass { - private Downloader downloader; - private PackageListsManager pkgListMan; /// @@ -160,10 +104,6 @@ namespace AllGet public MainClass() { - downloader = new Downloader(); - DownloadListener dl = new DownloadListener(); - downloader.DownloadEventRaised += new EventHandler(dl.OnDownload); - pkgListMan = new PackageListsManager(); pkgListMan.LoadPackageLists(); }