OSDN Git Service

all-get-lib,OSの情報をソートできるようににした。これによってパッケージ情報などで自然な順番で対応OSの表示をみることができるようになった
authorttp <ttp@users.sourceforge.jp>
Sat, 10 May 2008 03:09:53 +0000 (03:09 +0000)
committerttp <ttp@users.sourceforge.jp>
Sat, 10 May 2008 03:09:53 +0000 (03:09 +0000)
git-svn-id: http://localhost/svn/AppliStation/trunk@901 34ed2c89-c49f-4a4b-abdb-c318350108cf

na-get-lib/NaGet.Packages/Platform.cs

index d5ba839..f26bf30 100644 (file)
@@ -7,18 +7,18 @@ namespace NaGet.Packages
        /// <summary>\r
        /// PlatformのOSの種類をあらわす\r
        /// </summary>\r
-       public enum PlatformOSType\r
+       public enum PlatformOSType : ushort\r
        {\r
-               WIN95,\r
-               WIN98,\r
-               WINME,\r
+               WIN95 = 40,\r
+               WIN98 = 41,\r
+               WINME = 42,\r
                \r
-               WINNT4,\r
-               WIN2K,\r
-               WINXP,\r
-               WIN2003,\r
-               VISTA,\r
-               WIN2008,\r
+               WINNT4 = 140,\r
+               WIN2K = 150,\r
+               WINXP = 151,\r
+               WIN2003 = 152,\r
+               VISTA = 160,\r
+               WIN2008 = 161,\r
        }\r
        \r
        public class Platform\r
@@ -49,7 +49,7 @@ namespace NaGet.Packages
                                return string.Join(",", strs);\r
                        }\r
                        set {\r
-                               string[] strs = (value ?? "").Split(',');\r
+                               string[] strs = (value ?? string.Empty).Split(',');\r
                                System.Collections.Generic.List<PlatformOSType> list = new System.Collections.Generic.List<PlatformOSType>();\r
                                for (int i = 0; i < strs.Length; i++) {\r
                                        try {\r
@@ -57,6 +57,7 @@ namespace NaGet.Packages
                                        } catch (ArgumentException) {\r
                                        }\r
                                }\r
+                               list.Sort();\r
                                OsType = list.ToArray();\r
                        }\r
                }\r