/// 有効なレポジトリの配列を返す\r
/// </summary>\r
[XmlIgnore]\r
- public RepositoryInfo[] EnabledRepositories {\r
+ public IEnumerable<RepositoryInfo> EnabledRepositories {\r
get {\r
- return Array.FindAll(Repositories, delegate(RepositoryInfo repo) {\r
- return repo.Enabled;\r
- });\r
+ foreach (RepositoryInfo repo in Repositories) {\r
+ if (repo.Enabled) {\r
+ yield return repo;\r
+ }\r
+ }\r
}\r
}\r
- \r
+ }\r
+ \r
+ /// <summary>\r
+ /// レポジトリで提供されるソフトリストのフォーマットを返す\r
+ /// </summary>\r
+ public enum RepositoryType : uint\r
+ {\r
/// <summary>\r
- /// provider.list.txtから変換してRepositoriesListとして返す\r
+ /// AppliStation Native XML Format Version 1.0\r
/// </summary>\r
- /// <param name="path">変換もとのprovider.list.txtのパス</param>\r
- /// <returns>変換されたRepositoriesList</returns>\r
- public static RepositoriesList MigrateFromProviderListTxt(string path)\r
- {\r
- List<RepositoryInfo> repos = new List<RepositoryInfo>();\r
- using(System.IO.StreamReader reader = new System.IO.StreamReader(path)) {\r
- string line;\r
- while ((line = reader.ReadLine()) != null) {\r
- RepositoryInfo repo = new RepositoryInfo();\r
- repo.Enabled = true;\r
- repo.Url = new LocationEntry(line);\r
- repo.Name = string.Empty;\r
- repos.Add(repo);\r
- }\r
- }\r
- \r
- RepositoriesList repolist = new RepositoriesList();\r
- repolist.Repositories = repos.ToArray();\r
- return repolist;\r
- }\r
+ [XmlEnum(Name="ASNATIVEv1.0")]\r
+ APPLISTATION_NATIVE_XML_1_0 = 0,\r
}\r
\r
/// <summary>\r
public string Name;\r
\r
/// <summary>\r
+ /// ソフトリストの形式\r
+ /// </summary>\r
+ [XmlAttribute]\r
+ public RepositoryType Type;\r
+ \r
+ /// <summary>\r
/// ソフトリストの取得先URL\r
/// </summary>\r
public LocationEntry Url;\r