OSDN Git Service

AppliStation-GUI,パッケージリストの列で「ライセンス」と「インストールした日」を追加(デフォルト非表示)。
[applistation/AppliStation.git] / AppliStation / AppliStation.PackageInfo / InstallerInfoForm.cs
1 using System;\r
2 using System.ComponentModel;\r
3 using System.Drawing;\r
4 using System.Windows.Forms;\r
5 \r
6 using NaGet.Packages;\r
7 using NaGet.Packages.Install;\r
8 using System.Reflection;\r
9 \r
10 namespace AppliStation.PackageInfo\r
11 {\r
12         /// <summary>\r
13         /// Description of InstallerInfoForm.\r
14         /// </summary>\r
15         public partial class InstallerInfoForm : UserControl\r
16         {\r
17                 private Installer inst;\r
18                 \r
19                 public InstallerInfoForm()\r
20                 {\r
21                         //\r
22                         // The InitializeComponent() call is required for Windows Forms designer support.\r
23                         //\r
24                         InitializeComponent();\r
25                 }\r
26                 \r
27                 public Installer SelectedObject {\r
28                         get { return inst; }\r
29                         set {\r
30                                 inst = value;\r
31                                 updateInst();\r
32                         }\r
33                 }\r
34                 \r
35                 private void updateInst()\r
36                 {\r
37                         installerUrlTextBox.Text = (inst == null || inst.Url == null)?\r
38                                 string.Empty : inst.Url.Href;\r
39                                                 \r
40                         osValueLabel.Text = PackageDescripter.GetOSValueLabel(inst.Platform);\r
41                         archValueLabel.Text = PackageDescripter.GetArchValueLabel(inst.Platform);\r
42                         \r
43                         cannotRunLabel.Visible = ! ((inst.Platform == null) || inst.Platform.IsRunnable());\r
44                 }\r
45         }\r
46 }\r