OSDN Git Service

initial build for opensource
[applistation/AppliStation.git] / na-get-lib / NaGet.Packages / ProviderList.cs
1 using System;\r
2 using System.IO;\r
3 using System.Collections.Generic;\r
4 \r
5 namespace NaGet.Packages\r
6 {\r
7         /// <summary>\r
8         /// パッケージリストを提供するプロバイダのリストを示すクラス\r
9         /// </summary>\r
10         public class ProviderList\r
11         {\r
12                 /// <summary>\r
13                 /// パッケージリストのリソースURLの配列\r
14                 /// </summary>\r
15                 public string[] Urls;\r
16                 \r
17                 /// <summary>\r
18                 /// コンストラクタ\r
19                 /// </summary>\r
20                 public ProviderList()\r
21                 {\r
22                 }\r
23 \r
24                 /// <summary>\r
25                 /// コンストラクタ\r
26                 /// </summary>\r
27                 /// <param name="path">プロバイダリストのファイルのパス</param>\r
28                 public ProviderList(string path)\r
29                 {\r
30                         List<string> providerList = new List<string>();\r
31                         using(StreamReader reader = new StreamReader(path)) {\r
32                                 string line;\r
33                                 while ((line = reader.ReadLine()) != null) {\r
34                                         providerList.Add(line);\r
35                                 }\r
36                         }\r
37                         \r
38                         Urls = providerList.ToArray();\r
39                 }\r
40         }\r
41 }\r