OSDN Git Service

na-get-lib,UserAgentをアセンブリバージョンなどから取得するよう変更
[applistation/AppliStation.git] / all-get / Main.cs
index d69d548..a4be970 100644 (file)
@@ -2,7 +2,6 @@
 using System;\r
 using System.IO;\r
 using System.Collections.Generic;\r
-using NaGet.Net;\r
 using NaGet.Packages;\r
 using NaGet.Packages.Install;\r
 using NaGet.SubCommands;\r
@@ -10,59 +9,6 @@ using NaGet.Tasks;
 \r
 namespace AllGet\r
 {\r
-\r
-       class DownloadListener\r
-       {\r
-               private string line = null;\r
-               \r
-               /// <summary>\r
-               /// lineのコンソール上における長さ\r
-               /// </summary>\r
-               private int lineWidth = 0;\r
-       \r
-               public void OnDownload(object sender, DownloadEventArgs a) {\r
-                       if (line != null) {\r
-                               lock (line) {\r
-                                       int newpos = (lineWidth <= 0)? 0 : Console.CursorLeft - lineWidth;\r
-                                       if (newpos < 0) newpos = 0;\r
-                                       \r
-                                       // 空白で埋める\r
-                                       Console.CursorLeft = newpos;\r
-                                       for (int i = 0; i < lineWidth && Console.CursorLeft < Console.BufferWidth; i++) {\r
-                                               Console.Write(' ');\r
-                                       }\r
-                                       Console.CursorLeft = newpos;\r
-                                       \r
-                                       line = null; lineWidth = 0;\r
-                               }\r
-                       }\r
-                       \r
-                       switch (a.DownloadTaskType) {\r
-                       case DownloadEventType.INITED:\r
-                               line = "starting...";\r
-                               break;\r
-                       case DownloadEventType.CONNECTED:\r
-                       case DownloadEventType.DOWNLOADING:\r
-                               line = a.TaskMessage;\r
-                               break;\r
-                       case DownloadEventType.COMPLETED:\r
-                               //\r
-                               line = null;\r
-                               break;\r
-                       case DownloadEventType.ERROR:\r
-                               Console.Write("interrupted! ERROR!");\r
-                               line = null;\r
-                               break;\r
-                       }\r
-                       \r
-                       if (line != null) {\r
-                               int posOld = Console.CursorLeft;\r
-                               Console.Write(line);\r
-                               lineWidth = Console.CursorLeft - posOld;\r
-                       }\r
-               }\r
-       }\r
-\r
        sealed class TaskSetEventHandlers\r
        {\r
                public static void OnTaskSetEvent(object sender, TaskEventArgs e) { \r
@@ -149,8 +95,6 @@ namespace AllGet
        \r
        class MainClass\r
        {\r
-               private Downloader downloader;\r
-               \r
                private PackageListsManager pkgListMan;\r
                \r
                /// <summary>\r
@@ -160,10 +104,6 @@ namespace AllGet
                \r
                public MainClass()\r
                {\r
-                       downloader = new Downloader();\r
-                       DownloadListener dl = new DownloadListener();\r
-                       downloader.DownloadEventRaised += new EventHandler<DownloadEventArgs>(dl.OnDownload);\r
-                       \r
                        pkgListMan = new PackageListsManager();\r
                        pkgListMan.LoadPackageLists();\r
                }\r