2 using System.Drawing;
\r
3 using System.Windows.Forms;
\r
4 using NaGet.Packages;
\r
5 using NaGet.Packages.Install;
\r
7 namespace AppliStation
\r
10 /// Description of PackageUninstallConfirmForm.
\r
12 public partial class PackageUninstallConfirmForm : Form
\r
14 private InstalledPackage uninstallPackage;
\r
16 public InstalledPackage UninstallPackage {
\r
17 get { return uninstallPackage; }
\r
19 uninstallPackage = value;
\r
21 label2.Text = string.Format("{0}({1})", uninstallPackage.Name, uninstallPackage.Version);
\r
22 label2.Font = new Font(SystemFonts.DefaultFont.FontFamily, SystemFonts.DefaultFont.Size*1.5f);
\r
24 string iconPath = uninstallPackage.UninstallInfo.IconPath;
\r
25 if (!string.IsNullOrEmpty(iconPath)) {
\r
26 if (iconPath.EndsWith(",0")) {
\r
27 iconPath = iconPath.Substring(0, iconPath.Length-2);
\r
29 if (System.IO.File.Exists(iconPath)) {
\r
30 iconLabel.Image = Icon.ExtractAssociatedIcon(iconPath).ToBitmap();
\r
31 iconLabel.Size = iconLabel.Image.Size;
\r
37 public PackageUninstallConfirmForm()
\r
40 // The InitializeComponent() call is required for Windows Forms designer support.
\r
42 InitializeComponent();
\r
44 //
\8aÇ
\97\9d\8eÒ
\8c \8cÀ
\82Å
\93®
\82¢
\82Ä
\82¢
\82é
\82È
\82ç
\82Îrunas
\82ª
\95K
\97v
\82É
\82Í
\82È
\82ç
\82È
\82¢
\82Ì
\82Å
\95\
\8e¦
\82µ
\82È
\82¢
\r
45 if (NaGet.Utils.IsAdministrators()) {
\r
46 runasCheckBox.Checked = false;
\r
47 runasCheckBox.Visible = false;
\r
51 #region runas
\8aÖ
\98A
\r
54 /// runas
\82Å
\8eÀ
\8ds
\82·
\82é
\82©
\94Û
\82©
\r
56 public bool UseRunas {
\r
58 runasCheckBox.Checked = (! NaGet.Utils.IsAdministrators()) && value;
\r
63 return runasCheckBox.Checked;
\r
68 ///
\91I
\91ð
\82³
\82ê
\82½
\83p
\83b
\83P
\81[
\83W
\82ð
\92²
\8d¸
\82µ
\82Ä
\81ARunas
\82ð
\8eg
\82¤
\82×
\82«
\82©
\82¢
\82È
\82©
\82ð
\95Ô
\82·
\r
70 public bool GetShouldUseRunas()
\r
72 if (NaGet.Utils.IsAdministrators()) {
\r
73 //
\8aÇ
\97\9d\8eÒ
\8c \8cÀ
\82Å
\93®
\82¢
\82Ä
\82¢
\82é
\8fê
\8d\87\82Í
\95s
\97v
\r
77 return (uninstallPackage.Type != InstallerType.ARCHIVE);
\r
80 void RunasCheckBoxCheckedChanged(object sender, EventArgs e)
\r
85 private void updateUseRunas()
\r
88 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackagesInstallConfirmForm));
\r
89 okButton.Image = ((System.Drawing.Bitmap)(resources.GetObject("okButton.Image")));
\r
91 okButton.Image = null;
\r