X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=blobdiff_plain;f=AppliStation%2FPackageListViewForm.cs;h=a66d9a69137f1bdb64f72e25524780ca4c63f860;hp=a0eb691ec97634424490b6eae123640202da08b2;hb=202377d120df8670eca37760385d1f3616b6f8a1;hpb=16cd726bbaa2e0861659ded371f4b6f0a6c56ead
diff --git a/AppliStation/PackageListViewForm.cs b/AppliStation/PackageListViewForm.cs
index a0eb691..a66d9a6 100644
--- a/AppliStation/PackageListViewForm.cs
+++ b/AppliStation/PackageListViewForm.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Drawing;
using System.Windows.Forms;
using NaGet.Packages;
@@ -6,6 +6,8 @@ using NaGet.Packages.Install;
using System.IO;
using System.Collections.Generic;
+using AppliStation.PackageInfo;
+
namespace AppliStation
{
///
@@ -13,7 +15,7 @@ namespace AppliStation
///
public partial class PackageListViewForm : Form
{
- protected PackageListsManager pkgListsMan = null;
+ private PackageListsManager pkgListsMan = null;
public PackageListViewForm()
{
@@ -26,162 +28,152 @@ namespace AppliStation
uninstallToolStripMenuItem.Font = new Font(uninstallToolStripMenuItem.Font, FontStyle.Bold);
pkgListsMan = new PackageListsManager();
+ packageListView.Data = pkgListsMan;
this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
+ AppliStation.Util.NativeMethods.ListView_EnableVistaExplorerTheme(packageListView);
+ AppliStation.Util.NativeMethods.ListView_SetDoubleBuffer(packageListView, true);
}
- void PackageListViewSelectedIndexChanged(object sender, EventArgs e)
+ private void ShowInfoToDetailBoxFor(Package pkg)
{
- bool installBtnEnabled = false;
- bool uninstallBtnEnabled = false;
-
detailBox.Clear();
- foreach (ListViewItem item in packageListView.SelectedItems) {
- Package pkg = (Package) item.Tag;
-
- bool isInstalledPackage = pkg is InstalledPackage;
- uninstallBtnEnabled = isInstalledPackage;
- installBtnEnabled = ! isInstalledPackage;
-
- detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 12);
- detailBox.SelectedText += string.Format("{0} ({1})\r\n", pkg.Name, pkg.Version);
- if (! string.IsNullOrEmpty(pkg.Tags) ) {
- detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 8);
- detailBox.SelectedText += string.Format("^O: {0}\r\n", pkg.Tags);
+
+ detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 12);
+ detailBox.SelectedText += string.Format("{0} ({1})\r\n", pkg.Name, pkg.Version);
+ if (! string.IsNullOrEmpty(pkg.Tags) ) {
+ detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 8);
+ detailBox.SelectedText += "ã¿ã°:";
+ foreach (string tag in pkg.Tags.Split(' ')) {
+ detailBox.AppendText(" ");
+ AppliStation.Util.NativeMethods.RichTextBox_AddTextLink(detailBox, tag);
}
- if (isInstalledPackage) {
- InstalledPackage iPkg = (InstalledPackage) pkg;
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
- if (iPkg.UninstallInfo.InstallDate != null) {
- sb.AppendFormat("CXg[µ½ú: {0:d} ", iPkg.UninstallInfo.InstallDate.Value);
- }
- if (iPkg.UninstallInfo.EstimatedSize > 0) {
- sb.AppendFormat("TCY: {0} ", NaGet.Utils.FormatSize(iPkg.UninstallInfo.EstimatedSize*1024));
- }
-
- if (sb.Length > 0) {
- detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 8);
- detailBox.SelectedText += sb.ToString();
- detailBox.SelectedText += "\r\n";
- }
+ detailBox.AppendText("\r\n");
+ }
+
+ // ã¤ã³ã¹ãã¼ã«æ¸ã¿ããã±ã¼ã¸ã®å ´å
+ InstalledPackage iPkg = pkg as InstalledPackage;
+ if (iPkg != null) {
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ if (iPkg.UninstallInfo.InstallDate != null) {
+ sb.AppendFormat("ã¤ã³ã¹ãã¼ã«ããæ¥: {0:d} ", iPkg.UninstallInfo.InstallDate.Value);
}
- detailBox.SelectionFont = detailBox.Font;
- if (pkg.Url != null && pkg.Url.Href != null) {
- detailBox.SelectedText += "ö®TCg: " + pkg.Url.Href + "\r\n";
+ if (iPkg.UninstallInfo.EstimatedSize > 0) {
+ sb.AppendFormat("ãµã¤ãº: {0} ", NaGet.Utils.FormatSize(iPkg.UninstallInfo.EstimatedSize*1024));
}
- detailBox.SelectedText += pkg.Summary;
- break;
+ if (sb.Length > 0) {
+ detailBox.SelectionFont = new Font(detailBox.Font.FontFamily, 8);
+ detailBox.SelectedText += sb.ToString();
+ detailBox.SelectedText += "\r\n";
+ }
}
+ detailBox.SelectionFont = detailBox.Font;
+ if (pkg.Url != null && pkg.Url.Href != null) {
+ detailBox.SelectedText += "å
¬å¼ãµã¤ã: ";
+ AppliStation.Util.NativeMethods.RichTextBox_AddTextLink(detailBox, pkg.Url.Href);
+ detailBox.SelectedText += "\r\n";
+ }
+ detailBox.SelectedText += pkg.Summary;
+ }
+
+ void PackageListViewSelectedIndexChanged(object sender, EventArgs e)
+ {
+ updateSelectedPackages();
+ }
+
+ private void updateSelectedPackages()
+ {
+ uint installPkgCount = 0;
+ uint uninstallPkgCount = 0;
+ bool installBtnEnabled, uninstallBtnEnabled;
+ foreach (Package pkg in packageListView.SelectedPackages) {
+ if (pkg is InstalledPackage) {
+ uninstallPkgCount ++;
+ } else {
+ installPkgCount ++;
+ }
+ }
+
+ uint pkgCount = installPkgCount + uninstallPkgCount;
+ installBtnEnabled = (installPkgCount > 0) && (uninstallPkgCount == 0);
+ uninstallBtnEnabled = (uninstallPkgCount == 1) && (installPkgCount == 0);
+
+ // ToolStrip
+ informationToolStripDropDownButton.Visible = (pkgCount == 1);
uninstallToolStripButton.Visible = uninstallBtnEnabled;
installToolStripButton.Visible = installBtnEnabled;
- packageCommandsToolStripSeparator.Visible = uninstallBtnEnabled || installBtnEnabled;
+ // MenuStrip
+ webResourceToolStripMenuItem.Visible = (pkgCount == 1);
+ uninstallToolStripMenuItem.Visible = uninstallBtnEnabled;
+ installToolStripMenuItem.Visible = installBtnEnabled;
+ downloadToolStripMenuItem.Visible = (pkgCount > 0);
- if (packageListView.SelectedItems.Count <= 0) {
- detailBox.SelectionFont = detailBox.Font;
- int count = packageListView.Items.Count;
- detailBox.Text = (count > 0) ? string.Format("{0}ÂÌ\tgª èÜ·B", count)
- : "Y·é\tgª èܹñB";
+ // detailBoxã®ã¡ãã»ã¼ã¸è¨å®
+ switch (pkgCount) {
+ case 0:
+ int count = packageListView.Items.Count;
+ detailBox.Clear();
+ detailBox.Text = (count > 0) ? string.Format("{0}åã®ã½ãããããã¾ãã", count)
+ : "該å½ããã½ãããããã¾ããã";
+ break;
+ case 1:
+ ShowInfoToDetailBoxFor(packageListView.SelectedPackage);
+ break;
+ default: // case 2 and over:
+ detailBox.Clear();
+ detailBox.Text = (installBtnEnabled)? string.Format("{0}åã®ã½ãããé¸æããã¦ãã¾ãã", installPkgCount) :
+ (uninstallBtnEnabled)? string.Format("{0}åã®ã¤ã³ã¹ãã¼ã«æ¸ã¿ã®ã½ãããé¸æããã¦ãã¾ãã", uninstallPkgCount) :
+ string.Format("{0}åã®ã½ãããé¸æããã¦ãã¾ãã\r\n(ãã¡{1}åã¯ã¤ã³ã¹ãã¼ã«æ¸ã¿ã{2}åã¯ã¤ã³ã¹ãã¼ã«å¯è½)", pkgCount, uninstallPkgCount, installPkgCount);
+ break;
}
- detailBox.SelectionStart = 0;
- detailBox.ScrollToCaret();
+ try {
+ detailBox.Select(0, 0);
+ detailBox.ScrollToCaret();
+ } catch (System.Runtime.InteropServices.COMException) {
+ // ScrollToCaretã§ããããã¨ããã
+ }
}
void PackageListViewItemActivate(object sender, EventArgs e)
{
- if (packageListView.SelectedItems.Count <= 0) {
- return; // exit
- }
+ Package pkg = packageListView.SelectedPackage;
- foreach (ListViewItem item in packageListView.SelectedItems) {
- Package pkg = (Package) item.Tag;
-
+ if (pkg != null) {
if (pkg is InstalledPackage) {
UninstallToolStripButtonClick(sender, e);
} else {
InstallToolStripButtonClick(sender, e);
}
-
- break;
- }
- }
-
- AppliStation.Util.ListViewItemSortComparer packageListViewSortComparer;
-
- void PackageListViewColumnClick(object sender, ColumnClickEventArgs e)
- {
- SortOrder order = SortOrder.None;
-
- if (packageListViewSortComparer == null) {
- order = SortOrder.Ascending;
- packageListViewSortComparer = new AppliStation.Util.ListViewItemSortComparer(e.Column, order);
- packageListView.ListViewItemSorter = packageListViewSortComparer;
- } else {
- if (packageListViewSortComparer.Column == e.Column) {
- order = (packageListViewSortComparer.Order == SortOrder.Ascending)? SortOrder.Descending : SortOrder.Ascending;
-
- packageListViewSortComparer.Order = order;
- } else {
- order = packageListViewSortComparer.Order;
- packageListViewSortComparer.Column = e.Column;
- }
-
- packageListView.Sort();
- }
- AppliStation.Util.NativeMethods.ColumnHeader_SetSortState(packageListView, e.Column, order);
-
- // \[gÎÛñÌFt¯
- try {
- // SendMessage(hWnd, LVM_SETSELECTEDCOLUMN, column, NULL);
- AppliStation.Util.NativeMethods.SendMessage(packageListView.Handle, 0x1000+140, (uint) e.Column, 0);
- } catch (Exception) {
}
}
void Form_OnLoad(object sender, EventArgs e)
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackageListViewForm));
- ImageList imageList = new ImageList();
- imageList.Images.Add("installed", this.Icon);
- imageList.Images.Add("sys", (Icon)(resources.GetObject("sysinstalled.Icon")));
- packageListView.SmallImageList = imageList;
+ packageListViewImageList.Images.Add("installed", Icon.ExtractAssociatedIcon(Application.ExecutablePath));
updatePackageFilterToolStripMenuItemCheckState();
- installedASPackageFilterToolStripMenuItem.Image = this.Icon.ToBitmap();
- installedSysPackageFilterToolStripMenuItem.Image = ((Icon)(resources.GetObject("sysinstalled.Icon"))).ToBitmap();
- }
-
- #region PackageFilterÖA
-
- private enum PackageFilterIndex : int
- {
- All = 0,
- NotInstalled = 1,
- InstalledAS = 2,
- InstalledSys = 3,
+ notInstalledPackageFilterToolStripMenuItem.Image = packageListViewImageList.Images["available-new"];
+ installedASPackageFilterToolStripMenuItem.Image = packageListViewImageList.Images["installed"];
+ installedSysPackageFilterToolStripMenuItem.Image = packageListViewImageList.Images["sys"];
+
+ packageListView.UpdateItems();
+ updateSelectedPackages();
}
- private PackageFilterIndex currentPackageFilter = PackageFilterIndex.All;
-
- private PackageFilterIndex CurrentPackageFilter {
- get {
- return currentPackageFilter;
- }
- set {
- currentPackageFilter = value;
-
- updatePackageFilterToolStripMenuItemCheckState();
- }
- }
+ #region PackageFilteré¢é£
+ ///
+ /// packgageFilterToolStripã®ãªã¹ããæ´æ°ããã
+ ///
private void updatePackageFilterToolStripMenuItemCheckState()
{
ToolStripMenuItem selected = getCheckedPackageFilterToolStripItem();
foreach (ToolStripMenuItem item in packageFilterToolStripDropDownButton.DropDown.Items) {
- item.Checked = selected == item;
+ item.Checked = (selected == item);
}
packageFilterToolStripDropDownButton.Text = selected.Text;
@@ -191,12 +183,12 @@ namespace AppliStation
private ToolStripMenuItem getCheckedPackageFilterToolStripItem()
{
- switch (currentPackageFilter) {
- case PackageFilterIndex.NotInstalled:
+ switch (packageListView.FilteringType) {
+ case PackageListViewPkgTypeFilter.NotInstalled:
return notInstalledPackageFilterToolStripMenuItem;
- case PackageFilterIndex.InstalledAS:
+ case PackageListViewPkgTypeFilter.InstalledAS:
return installedASPackageFilterToolStripMenuItem;
- case PackageFilterIndex.InstalledSys:
+ case PackageListViewPkgTypeFilter.InstalledSys:
return installedSysPackageFilterToolStripMenuItem;
default:
return allPackageFilterToolStripMenuItem;
@@ -206,92 +198,50 @@ namespace AppliStation
void AnyPackageFilterToolStripMenuItemClicked(object sender, EventArgs e)
{
if (sender == notInstalledPackageFilterToolStripMenuItem) {
- currentPackageFilter = PackageFilterIndex.NotInstalled;
+ packageListView.FilteringType = PackageListViewPkgTypeFilter.NotInstalled;
} else if (sender == installedASPackageFilterToolStripMenuItem) {
- currentPackageFilter = PackageFilterIndex.InstalledAS;
+ packageListView.FilteringType = PackageListViewPkgTypeFilter.InstalledAS;
} else if (sender == installedSysPackageFilterToolStripMenuItem) {
- currentPackageFilter = PackageFilterIndex.InstalledSys;
+ packageListView.FilteringType = PackageListViewPkgTypeFilter.InstalledSys;
} else {
- currentPackageFilter = PackageFilterIndex.All;
+ packageListView.FilteringType = PackageListViewPkgTypeFilter.All;
}
updatePackageFilterToolStripMenuItemCheckState();
searchTextBox.FireTextChangedTrigger();
- PackageListViewUpdate();
}
#endregion
- void PackageListViewUpdate()
+ void DetailBoxLinkClicked(object sender, LinkClickedEventArgs e)
{
- this.packageListView.Items.Clear();
-
- if (currentPackageFilter == PackageFilterIndex.All || currentPackageFilter == PackageFilterIndex.NotInstalled) {
- foreach (Package pkg in pkgListsMan.AvailablePkgList.Search(searchTextBox.Text)) {
- if (Installation.GetPreferInstallerIndex(pkg) >= 0) { // CXg[Â\
- if (currentPackageFilter == PackageFilterIndex.NotInstalled &&
- (pkgListsMan.InstalledPkgList.GetPackageForName(pkg.Name) != null||
- pkgListsMan.SystemInstalledPkgList.GetPackageForName(pkg.Name) != null) ) {
- continue; // CXg[ÏÝÍÌ[vÖ(¢CXg[\tgo)
- }
-
- ListViewItem item = new ListViewItem(new string[]{pkg.Name, pkg.Version, pkg.Summary});
- item.Tag = pkg;
- item.ToolTipText = pkg.Summary;
-
- this.packageListView.Items.Add(item);
- }
- }
- }
-
- if (currentPackageFilter == PackageFilterIndex.All || currentPackageFilter == PackageFilterIndex.InstalledAS) {
- foreach (Package pkg in pkgListsMan.InstalledPkgList.Search(searchTextBox.Text)) {
- ListViewItem item = new ListViewItem(new string[]{pkg.Name, pkg.Version, pkg.Summary});
- item.Tag = pkg;
- item.ToolTipText = pkg.Summary;
- item.ImageKey = "installed";
-
- this.packageListView.Items.Add(item);
- }
- }
-
- if (currentPackageFilter == PackageFilterIndex.All || currentPackageFilter == PackageFilterIndex.InstalledSys) {
- foreach (Package pkg in pkgListsMan.SystemInstalledPkgList.Search(searchTextBox.Text)) {
- ListViewItem item = new ListViewItem(new string[]{pkg.Name, pkg.Version, pkg.Summary});
- item.Tag = pkg;
- item.ToolTipText = pkg.Summary;
- item.ImageKey = "sys";
-
- this.packageListView.Items.Add(item);
+ if (System.Text.RegularExpressions.Regex.IsMatch(e.LinkText, "^https?://")){
+ /* URLã®å ´åã¯ãã©ã¦ã¶èµ·å */
+ try {
+ System.Diagnostics.Process.Start(e.LinkText);
+ } catch (System.ComponentModel.Win32Exception) {
+ MessageBox.Show(string.Format("{0}ãéãã®ã«å¤±æãã¾ããã", e.LinkText), "ãã©ã¦ã¶èµ·åã¨ã©ã¼", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
+ } else {
+ /* ãã以å¤ã¯ã¿ã°ã¨ã¿ãªãã¦æ¤ç´¢ */
+ searchTextBox.Text = e.LinkText;
}
-
- PackageListViewSelectedIndexChanged(packageListView, null);
- detailBox.Refresh();
-
- //this.packageListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
- }
-
- void PackageDetailBoxLinkClicked(object sender, LinkClickedEventArgs e)
- {
- System.Diagnostics.Process.Start(e.LinkText);
}
internal void updateActionInvoke(bool downloadPackageListsFlag)
{
AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();
prog.Shown += delegate(object sender2, EventArgs e2) {
- NaGet.SubCommands.NaGetUpdate tasks = new NaGet.SubCommands.NaGetUpdate(pkgListsMan, downloadPackageListsFlag);
- tasks.Downloader = prog.Downloader;
+ NaGet.SubCommands.NaGetUpdate2 tasks = new NaGet.SubCommands.NaGetUpdate2(pkgListsMan, downloadPackageListsFlag);
prog.SetTaskSet(tasks);
prog.Refresh();
prog.StartTaskSet();
};
- prog.Text = "XgÌXV";
+ prog.Text = "ãªã¹ãã®æ´æ°";
prog.ShowDialog(this);
}
- void UpdateToolStripButtonClick(object sender, EventArgs e)
+ void UpdateToolStripMenuItemClick(object sender, EventArgs e)
{
updateActionInvoke(true);
@@ -305,7 +255,143 @@ namespace AppliStation
UpdatePackageList();
}
- #region searchTextBoxÜíè
+ void SoftCollectionFileImportToolStripMenuItemClick(object sender, EventArgs e)
+ {
+ string pwd = Directory.GetCurrentDirectory();
+
+ OpenFileDialog fd = new OpenFileDialog();
+ fd.Filter = "ã½ããã³ã¬ã¯ã·ã§ã³ãã¡ã¤ã« (*.txt)|*.txt";
+ fd.DefaultExt = "txt";
+ fd.CheckFileExists = true;
+ fd.CheckPathExists = true;
+ fd.Multiselect = false;
+ fd.ShowDialog();
+ if (fd.FileNames.Length > 0) {
+ string filepath = Path.GetFullPath(fd.FileName);
+ Directory.SetCurrentDirectory(pwd); // ãã¡ã¤ã«ãã¤ã¢ãã°ã§å¤ãã£ãã«ã¬ã³ããã£ã¬ã¯ããªãæ»ã
+
+ IList pkgs;
+ IList invalid;
+
+ try {
+ PackageCollectionFileData collectionData = new PackageCollectionFileData();
+ collectionData.load(filepath);
+ collectionData.generatePackages(pkgListsMan, out pkgs, out invalid);
+
+ if (invalid.Count > 0) {
+ DialogResult result = MessageBox.Show("ä¸é¨èªã¿è¾¼ã¿ã®å¤±æããããã±ã¼ã¸ãããã¾ããç¶è¡ãã¾ãã?", "ã¤ã³ãã¼ã", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
+ if (result != DialogResult.OK) {
+ return;
+ }
+ }
+ } catch (IOException) {
+ MessageBox.Show("ãã¡ã¤ã«ã®èªã¿è¾¼ã¿ã«å¤±æãã¾ãã", "ã¤ã³ãã¼ã", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ {
+ InstallationConfirmForm confirm = new InstallationConfirmForm();
+ confirm.PkgListsManager = pkgListsMan;
+ confirm.Installations = Installation.ConvertInstallations( NaGet.Utils.IEnumerable2Array(pkgs) );
+ confirm.UseRunas = confirm.GetShouldUseRunas();
+ DialogResult result = confirm.ShowDialog(this);
+
+ if (result == DialogResult.OK) {
+ Installation[] insts = confirm.CheckedInstallations;
+
+ if (confirm.UseRunas) {
+ installRunasActionInvoke(insts);
+ } else {
+ installActionInvoke(insts);
+ }
+
+ UpdatePackageList();
+ }
+ }
+ } else {
+ Directory.SetCurrentDirectory(pwd); // ãã¡ã¤ã«ãã¤ã¢ãã°ã§å¤ãã£ãã«ã¬ã³ããã£ã¬ã¯ããªãæ»ã
+ }
+ }
+
+ void SoftCollectionFileExportToolStripMenuItemClick(object sender, EventArgs e)
+ {
+ string pwd = Directory.GetCurrentDirectory();
+ string[] softtargets = new string[]{
+ "PCã«ã¤ã³ã¹ãã¼ã«ãããã½ãã",
+ "AppliStationå
ã§ã¤ã³ã¹ãã¼ã«ãããã½ãã",
+ "ã¤ã³ã¹ãã¼ã«ãããã½ãããã¹ã¦;PCã¨AppliStationã«ã¤ã³ã¹ãã¼ã«ãããã½ããã®ä¸¡æ¹"
+ };
+ int softtargetid = softtargets.Length - 1;
+
+ {
+ AppliStation.Util.OptionDialog optdialog = AppliStation.Util.OptionDialog.createCommandSelectionDialog(
+ "ã½ããã³ã¬ã¯ã·ã§ã³ãã¡ã¤ã«ã«åºåããã½ããã®ç¨®é¡ãé¸æãã¦ãã ããã", "ã¨ã¯ã¹ãã¼ã", "ã¨ã¯ã¹ãã¼ãããã½ãã",
+ System.Drawing.SystemIcons.Question,
+ softtargets, softtargets.Length-1);
+ if (optdialog.ShowDialog(this) != DialogResult.OK) {
+ return; // canceled
+ } else if (optdialog.UserInputValue != null) {
+ softtargetid = (int) optdialog.UserInputValue;
+ }
+ }
+
+ SaveFileDialog fd = new SaveFileDialog();
+ fd.Filter = "ã½ããã³ã¬ã¯ã·ã§ã³ãã¡ã¤ã« (*.txt)|*.txt";
+ fd.DefaultExt = "txt";
+ fd.CheckPathExists = true;
+ fd.OverwritePrompt = true;
+ fd.ShowDialog();
+ if (fd.FileNames.Length > 0) {
+ string filepath = Path.GetFullPath(fd.FileName);
+ Directory.SetCurrentDirectory(pwd); // ãã¡ã¤ã«ãã¤ã¢ãã°ã§å¤ãã£ãã«ã¬ã³ããã£ã¬ã¯ããªãæ»ã
+
+ PackageCollectionFileData collectionData = new PackageCollectionFileData();
+
+ switch (softtargetid) {
+ case 0: // PCã«ã¤ã³ã¹ãã¼ã«
+ collectionData.loadPackages(pkgListsMan.SystemInstalledPkgList.GetEnumerator());
+ break;
+ case 1: // AppliStationå
ã«ã¤ã³ã¹ãã¼ã«
+ collectionData.loadPackages(pkgListsMan.InstalledPkgList.GetEnumerator());
+ break;
+ case 2: // ãã¹ã¦
+ default:
+ collectionData.loadPackages(pkgListsMan.GetAllInstalledPackages());
+ break;
+ }
+
+ try {
+ collectionData.saveAs(fd.FileName);
+ } catch (UnauthorizedAccessException) {
+ if ((File.GetAttributes(fd.FileName) & FileAttributes.ReadOnly) != 0) {
+ MessageBox.Show("èªã¿åãå°ç¨å±æ§ãè¨å®ããã¦ãã¾ãã\nå¥ã®ãã¡ã¤ã«ãæå®ãã¦ãã ããã", "ã¨ã¯ã¹ãã¼ã", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ } else {
+ MessageBox.Show("ãã¡ã¤ã«ã¸ã®æ¸ãè¾¼ã¿ã許å¯ããã¦ãã¾ããã\nå¥ã®ãã¡ã¤ã«ãæå®ãã¦ãã ããã", "ã¨ã¯ã¹ãã¼ã", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ return;
+ } catch (IOException) {
+ MessageBox.Show("ãã¡ã¤ã«ã®æ¸ãè¾¼ã¿ã«å¤±æãã¾ãã", "ã¨ã¯ã¹ãã¼ã", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ } else {
+ Directory.SetCurrentDirectory(pwd); // ãã¡ã¤ã«ãã¤ã¢ãã°ã§å¤ãã£ãã«ã¬ã³ããã£ã¬ã¯ããªãæ»ã
+ }
+ }
+
+ void OptionToolStripMenuItemClick(object sender, EventArgs e)
+ {
+ UserPrefForm userPrefForm = new UserPrefForm();
+ DialogResult result = userPrefForm.ShowDialog(this);
+
+ if (result == DialogResult.OK) {
+ if (userPrefForm.IsRepositoryListSettingChanged) {
+ updateActionInvoke(true);
+ UpdatePackageList();
+ }
+ }
+ }
+
+ #region searchTextBoxã¾ãã
void SearchTextBoxKeyPress(object sender, KeyPressEventArgs e)
{
@@ -321,57 +407,56 @@ namespace AppliStation
void SearchTextBoxTextChangedTriggerFired(object sender, EventArgs e)
{
- PackageListViewUpdate();
+ packageListView.FilteringKeyword = searchTextBox.Text;
}
#endregion
- internal void installActionInvoke(Package[] pkgs)
+ internal void installActionInvoke(Installation[] insts)
{
AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();
prog.Shown += delegate(object sender2, EventArgs e2) {
- NaGet.SubCommands.NaGetInstall tasks = new NaGet.SubCommands.NaGetInstall(pkgListsMan, pkgs);
- tasks.Downloader = prog.Downloader;
+ NaGet.SubCommands.NaGetInstall2 tasks = new NaGet.SubCommands.NaGetInstall2(pkgListsMan, insts);
prog.SetTaskSet(tasks);
prog.Refresh();
prog.StartTaskSet();
};
- prog.Text = string.Format("\tgEFAÌCXg[");
+ prog.Text = string.Format("ã½ããã¦ã§ã¢ã®ã¤ã³ã¹ãã¼ã«");
prog.ShowDialog(this);
}
void InstallToolStripButtonClick(object sender, EventArgs e)
{
- PackagesInstallConfirmForm confirm = new PackagesInstallConfirmForm();
+ InstallationConfirmForm confirm = new InstallationConfirmForm();
confirm.PkgListsManager = pkgListsMan;
- confirm.Packages = SelectedPackages();
+ confirm.Installations = Installation.ConvertInstallations( NaGet.Utils.IEnumerable2Array(packageListView.SelectedPackages) );
confirm.UseRunas = confirm.GetShouldUseRunas();
DialogResult result = confirm.ShowDialog(this);
if (result == DialogResult.OK) {
- Package[] instPkgs = confirm.CheckedPackages;
+ Installation[] insts = confirm.CheckedInstallations;
if (confirm.UseRunas) {
- installRunasActionInvoke(instPkgs);
+ installRunasActionInvoke(insts);
} else {
- installActionInvoke(instPkgs);
+ installActionInvoke(insts);
}
UpdatePackageList();
}
}
- public void installRunasActionInvoke(Package[] pkgs)
+ public void installRunasActionInvoke(Installation[] insts)
{
- this.Enabled = false;
+ this.setWindowEnabled(false);
- string tmpfileName = System.IO.Path.GetTempFileName();
+ string tmpfileName = Path.GetTempFileName();
try {
- NaGet.Utils.PutSerializeObject(tmpfileName, pkgs);
+ NaGet.Utils.PutSerializeObject(tmpfileName, insts);
System.Diagnostics.ProcessStartInfo procInfo = new System.Diagnostics.ProcessStartInfo();
procInfo.FileName = Application.ExecutablePath;
- procInfo.Arguments = string.Format("--noupdate --cmd=install \"--pkgsref={0}\"", tmpfileName);
+ procInfo.Arguments = string.Format("--noupdate --cmd=install \"--instsref={0}\"", tmpfileName);
procInfo.Verb = "runas";
procInfo.WorkingDirectory = Environment.CurrentDirectory;
@@ -379,9 +464,9 @@ namespace AppliStation
hProc.EnableRaisingEvents = true;
hProc.SynchronizingObject = this;
hProc.Exited += delegate(object sender, EventArgs e) {
- pkgListsMan.LoadPackageLists();
+ UpdatePackageList();
- this.Enabled = true;
+ this.setWindowEnabled(true);
this.BringToFront();
if (File.Exists(tmpfileName)) {
@@ -389,12 +474,11 @@ namespace AppliStation
}
};
} catch (System.ComponentModel.Win32Exception ex) {
- MessageBox.Show(ex.Message, "CXg[", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(ex.Message, "ã¤ã³ã¹ãã¼ã«", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (File.Exists(tmpfileName)) {
File.Delete(tmpfileName);
- }
- this.Enabled = true;
+ } this.setWindowEnabled(true);
}
}
@@ -402,20 +486,20 @@ namespace AppliStation
{
AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();
prog.Shown += delegate(object sender2, EventArgs e2) {
- NaGet.SubCommands.NaGetUninstall tasks = new NaGet.SubCommands.NaGetUninstall(pkgListsMan, pkgs);
+ NaGet.SubCommands.NaGetUninstall2 tasks = new NaGet.SubCommands.NaGetUninstall2(pkgListsMan, pkgs);
prog.SetTaskSet(tasks);
prog.Refresh();
prog.StartTaskSet();
};
- prog.Text = string.Format("\tgEFAÌACXg[");
+ prog.Text = string.Format("ã½ããã¦ã§ã¢ã®ã¢ã³ã¤ã³ã¹ãã¼ã«");
prog.ShowDialog(this);
}
internal void uninstallRunasActionInvoke(InstalledPackage[] pkgs)
- {
- this.Enabled = false;
+ {
+ this.setWindowEnabled(false);
- string tmpfileName = System.IO.Path.GetTempFileName();
+ string tmpfileName = Path.GetTempFileName();
try {
NaGet.Utils.PutSerializeObject(tmpfileName, pkgs);
@@ -429,9 +513,9 @@ namespace AppliStation
hProc.EnableRaisingEvents = true;
hProc.SynchronizingObject = this;
hProc.Exited += delegate(object sender, EventArgs e) {
- pkgListsMan.LoadPackageLists();
+ UpdatePackageList();
- this.Enabled = true;
+ this.setWindowEnabled(true);
this.BringToFront();
if (File.Exists(tmpfileName)) {
@@ -439,22 +523,19 @@ namespace AppliStation
}
};
} catch (System.ComponentModel.Win32Exception ex) {
- MessageBox.Show(ex.Message, "ACXg[", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(ex.Message, "ã¢ã³ã¤ã³ã¹ãã¼ã«", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ this.setWindowEnabled(true);
if (File.Exists(tmpfileName)) {
File.Delete(tmpfileName);
}
- this.Enabled = true;
}
}
void UninstallToolStripButtonClick(object sender, EventArgs e)
{
PackageUninstallConfirmForm confirm = new PackageUninstallConfirmForm();
- foreach (InstalledPackage pkg in SelectedPackages()) {
- confirm.UninstallPackage = pkg;
- break;
- }
+ confirm.UninstallPackage = (InstalledPackage) packageListView.SelectedPackage;
confirm.UseRunas = confirm.GetShouldUseRunas();
DialogResult result = confirm.ShowDialog(this);
@@ -462,10 +543,7 @@ namespace AppliStation
InstalledPackage[] instPkgs = new InstalledPackage[]{confirm.UninstallPackage};
if (confirm.UseRunas) {
- this.Enabled = false;
uninstallRunasActionInvoke(instPkgs);
- this.Enabled = true;
- this.Focus();
} else {
uninstallActionInvoke(instPkgs);
}
@@ -474,149 +552,274 @@ namespace AppliStation
}
}
+ internal void downloadActionInvoke(Installation[] pkgs)
+ {
+ AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();
+ prog.Shown += delegate(object sender2, EventArgs e2) {
+ NaGet.SubCommands.NaGetDownloadToCache2 tasks = new NaGet.SubCommands.NaGetDownloadToCache2(pkgListsMan, pkgs);
+ prog.SetTaskSet(tasks);
+ prog.Refresh();
+ prog.StartTaskSet();
+ };
+ prog.Text = string.Format("ãã£ãã·ã¥ã¸ã®ãã¦ã³ãã¼ã");
+ prog.ShowDialog(this);
+ }
+
+ void DownloadToolStripMenuItemClick(object sender, EventArgs e)
+ {
+ Installation[] insts = Installation.ConvertInstallations( NaGet.Utils.IEnumerable2Array(packageListView.SelectedPackages) );
+
+ downloadActionInvoke(insts);
+
+ UpdatePackageList();
+ }
- void WebOfficialToolStripMenuItemClick(object sender, EventArgs e)
+ void WebOfficialMenuItemClick(object sender, EventArgs e)
{
- foreach (Package pkg in SelectedPackages()) {
+ Package pkg = packageListView.SelectedPackage;
+ if (pkg != null) {
string linkURL = pkg.Url.Href;
- if (! (pkg == null || string.IsNullOrEmpty(linkURL))) {
- System.Diagnostics.Process.Start(linkURL);
+ if (! string.IsNullOrEmpty(linkURL)) {
+ try {
+ System.Diagnostics.Process.Start(linkURL);
+ } catch (System.ComponentModel.Win32Exception) {
+ MessageBox.Show(string.Format("{0}ãéãã®ã«å¤±æãã¾ããã", linkURL), "ãã©ã¦ã¶èµ·åã¨ã©ã¼", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
}
- break;
}
}
- void WebGoogleSearchToolStripMenuItemClick(object sender, EventArgs e)
+ void WebGoogleSearchMenuItemClick(object sender, EventArgs e)
{
- foreach (Package pkg in SelectedPackages()) {
+ Package pkg = packageListView.SelectedPackage;
+ if (pkg != null) {
string q = System.Web.HttpUtility.UrlEncode(pkg.Name, System.Text.Encoding.UTF8);
string googleURL = @"http://www.google.co.jp/search?q="+q;
- System.Diagnostics.Process.Start(googleURL);
-
- break;
+ try {
+ System.Diagnostics.Process.Start(googleURL);
+ } catch (System.ComponentModel.Win32Exception) {
+ MessageBox.Show("Googleãéãã®ã«å¤±æãã¾ããã", "ãã©ã¦ã¶èµ·åã¨ã©ã¼", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
}
}
void OpenInstalledDirectoryStripMenuItemClick(object sender, EventArgs e)
{
- foreach (InstalledPackage pkg in SelectedPackages()) {
- if (pkg.Type == InstallerType.ARCHIVE) {
+ InstalledPackage pkg = (InstalledPackage) packageListView.SelectedPackage;
+ if (pkg != null) {
+ if (pkg.Type == InstallerType.ARCHIVE || pkg.Type == InstallerType.ITSELF) {
System.Diagnostics.Process.Start(Path.Combine(NaGet.Env.ArchiveProgramFiles, pkg.Name));
- } else if (Directory.Exists(pkg.UninstallInfo.InstallLocation)) {
- System.Diagnostics.Process.Start(pkg.UninstallInfo.InstallLocation);
+ } else if (Directory.Exists(pkg.DiscoverInstalledLocation())) {
+ System.Diagnostics.Process.Start(pkg.DiscoverInstalledLocation());
}
-
- break;
}
}
- void PropertiesToolStripMenuItemClick(object sender, EventArgs e)
+ void PropertiesCommonMenuItemClick(object sender, EventArgs e)
{
- foreach (Package pkg in SelectedPackages()) {
+ if (packageListView.SelectedItems.Count >= 5) {
+ string msg = string.Format("{0}åã®ããããã£ãã¤ã¢ãã°ãéããã¨ãã¦ãã¾ãã\nç¶ç¶ãã¾ãã?", packageListView.SelectedItems.Count);
+ if (MessageBox.Show(msg, "ããããã£", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) {
+ return;
+ }
+ }
+
+ foreach (Package pkg in packageListView.SelectedPackages) {
PackageInfoForm form = new PackageInfoForm();
form.SelectedObject = pkg;
- form.Text = string.Format("{0}({1})ÌvpeB", pkg.Name, pkg.Version);
+ form.Text = string.Format("{0}({1})ã®ããããã£", pkg.Name, pkg.Version);
- form.ShowDialog(this);
-
- break;
+ form.Show(this);
}
}
- void PackageListContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)
+ private void updateLauncherMenuItem(AppliStation.Util.ToolStripPetitLauncherMenuItem launcherMenuItem)
{
- // Ið³êĢȢÈçJ©È¢
- if (packageListView.SelectedItems.Count <= 0) {
- e.Cancel = true;
- return;
- }
+ bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1;
- foreach (Package pkg in SelectedPackages()) {
- bool isInstalledPackage = pkg is InstalledPackage;
-
- installToolStripMenuItem.Visible = ! isInstalledPackage;
- uninstallToolStripMenuItem.Visible = isInstalledPackage;
+ if (selectionIsOnlyOne) {
+ Package pkg = packageListView.SelectedPackage;
+ InstalledPackage iPkg = pkg as InstalledPackage;
- webResourcesToolStripMenuItem.Text = string.Format(webResourcesToolStripMenuItem.Tag.ToString(), pkg.Name);
- webOfficialToolStripMenuItem.Enabled = ! (pkg.Url == null || string.IsNullOrEmpty(pkg.Url.Href));
- // webGoogleSearchToolStripMenuItem always active.
-
- openInstalledDirectoryStripMenuItem.Visible = isInstalledPackage &&
- ( (pkg.Type == InstallerType.ARCHIVE) || Directory.Exists(((InstalledPackage) pkg).UninstallInfo.InstallLocation) );
-
- break;
+ // ã¤ã³ã¹ãã¼ã«æ¸ã¿ããã±ã¼ã¸ã®ã¨ã
+ if (iPkg != null) {
+ bool launcherMenuItemVisible =
+ (pkg.Type == InstallerType.ARCHIVE) ||
+ (pkg.Type == InstallerType.ITSELF) ||
+ Directory.Exists(iPkg.DiscoverInstalledLocation());
+
+ launcherMenuItem.Visible = launcherMenuItemVisible;
+ if (launcherMenuItemVisible) {
+ launcherMenuItem.BaseFolderPath = iPkg.DiscoverInstalledLocation();
+ }
+ } else {
+ launcherMenuItem.Visible = false;
+ }
+ } else {
+ launcherMenuItem.Visible = false;
}
}
- private IEnumerable getUpdatedPackages(PackageList installedPkgList, PackageList avaiablePkgList, IComparer verComp)
+ void PackageListContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)
{
- foreach (InstalledPackage pkg in installedPkgList.Packages) {
- Package avaiablePkg = avaiablePkgList.GetPackageForName(pkg.Name);
-
- if (avaiablePkgList != null) {
- if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&
- installedPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {
-
- yield return avaiablePkg;
- }
+ bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1;
+ bool hasSelection = packageListView.SelectedItems.Count > 0;
+
+ updateSelectedPackages();
+
+ // ã¤ã³ã¹ãã¼ã«å
ã®ãã©ã«ãã®è¨å®
+ updateLauncherMenuItem(installedDirectoryToolStripMenuItem);
+
+ if (packageListView.View == View.Details) {
+ // ãããé¨ãã¯ãªãã¯ãããã¨ããããã±ã¼ã¸ãé¸æããã¦ããªããã®ã¨ãã¦æ±ã£ã¦å¦çãããã
+ int headerHeight = AppliStation.Util.NativeMethods.ColumnHeader_GetSize(packageListView).Height;
+ if (packageListView.PointToClient(packageListContextMenuStrip.Location).Y < headerHeight) {
+ selectionIsOnlyOne = hasSelection = false;
+ installToolStripMenuItem.Visible = false;
+ uninstallToolStripMenuItem.Visible = false;
+ installedDirectoryToolStripMenuItem.Visible = false;
}
}
+
+ packageListContextMenuStripSeparator.Visible = selectionIsOnlyOne;
+ webResourceToolStripMenuItem.Visible = selectionIsOnlyOne;
+ propertiesToolStripMenuItem.Visible = hasSelection;
+ columnToolStripMenuItem.Visible = (! hasSelection) && (packageListView.View == View.Details);
}
- void UpgradeToolStripButtonClick(object sender, EventArgs e)
+ void InformationToolStripDropDownButtonDropDownOpening(object sender, EventArgs e)
+ {
+ bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1;
+ bool hasSelection = packageListView.SelectedItems.Count > 0;
+
+ // ã¤ã³ã¹ãã¼ã«å
ã®ãã©ã«ãã®è¨å®
+ updateLauncherMenuItem(installedDirectoryMenuItem);
+
+ webResourceMenuItem.Visible = selectionIsOnlyOne;
+ propertiesMenuItem.Visible = hasSelection;
+ }
+
+ void WebResourceCommonContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)
{
- List pkgs = new List();
- VersionComparetor verComp = new VersionComparetor();
- PackageList avaiablePackageList = pkgListsMan.AvailablePkgList;
+ Package pkg = packageListView.SelectedPackage;
+
+ if (pkg != null && pkg.Url != null && !string.IsNullOrEmpty(pkg.Url.Href)) {
+ webOfficialMenuItem.Enabled = true;
+ webOfficialMenuItem.ToolTipText = pkg.Url.Href;
+ } else {
+ webOfficialMenuItem.Enabled = false;
+ webOfficialMenuItem.ToolTipText = null;
+ }
- pkgs.AddRange(getUpdatedPackages(pkgListsMan.InstalledPkgList, avaiablePackageList, verComp));
- pkgs.AddRange(getUpdatedPackages(pkgListsMan.SystemInstalledPkgList, avaiablePackageList, verComp));
+ // webGoogleSearchMenuItem always active.
+ }
+
+ void UpgradeToolStripButtonClick(object sender, EventArgs e)
+ {
+ List pkgs = new List(
+ UpgradeFinder.GetUpgradePackages(pkgListsMan)
+ );
if (pkgs.Count <= 0) {
- MessageBox.Show(this, "XV³ê½\tgÍ èܹñ", "\tgÌXV");
+ MessageBox.Show(this, "æ´æ°ãããã½ããã¯ããã¾ãã", "ã½ããã®æ´æ°");
return;
}
- PackagesInstallConfirmForm confirm = new PackagesInstallConfirmForm();
+ InstallationConfirmForm confirm = new InstallationConfirmForm();
confirm.PkgListsManager = pkgListsMan;
- confirm.Packages = pkgs.ToArray();
+ confirm.Installations = Installation.ConvertInstallations(pkgs.ToArray());
DialogResult result = confirm.ShowDialog(this);
if (result == DialogResult.OK) {
- Package[] instPkgs = confirm.CheckedPackages;
+ Installation[] insts = confirm.CheckedInstallations;
if (confirm.UseRunas) {
- this.Enabled = false;
- installRunasActionInvoke(instPkgs);
- this.Enabled = true;
+ installRunasActionInvoke(insts);
} else {
- installActionInvoke(instPkgs);
+ installActionInvoke(insts);
}
UpdatePackageList();
}
}
+ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
+ {
+ if ((int)keyData == (int)Keys.Control + (int)Keys.E) {
+ searchTextBox.SelectAll();
+ searchTextBox.Focus();
+ return true;
+ }
+
+ return base.ProcessCmdKey(ref msg, keyData);
+ }
+
public void UpdatePackageList()
{
pkgListsMan.LoadPackageLists();
- this.PackageListViewUpdate();
+ packageListView.UpdateItems();
+ updateSelectedPackages();
}
///
- /// CXg[·éæ¤Ið³ê½pbP[WÌzñ
+ /// èªã¦ã£ã³ãã¦ã®æå¹ç¡å¹(Enabled)ã(å¿
è¦ããã°Invokeãã¦)å®è¡ãã
///
- public TPackage[] SelectedPackages() where TPackage : Package
+ /// æå¹ãå¦ããEnabledã®å¤ã«å
¥ãããã
+ private void setWindowEnabled(bool enabled)
{
- List pkgs = new List();
- foreach (ListViewItem item in packageListView.SelectedItems) {
- pkgs.Add((TPackage) item.Tag);
+ MethodInvoker process = (MethodInvoker) delegate() {
+ this.Enabled = enabled;
+ };
+
+ if (InvokeRequired) {
+ Invoke(process);
+ } else {
+ process.Invoke();
+ }
+ }
+
+ void ColumnCommonToolStripMenuItemClick(object sender, EventArgs e)
+ {
+ packageListView.BeginUpdate();
+ ColumnHeader sortcolumn = packageListView.SortColumn;
+
+ // åã®è¿½å ã¨åé¤
+ foreach (ToolStripItem item in columnToolStripMenuItem.DropDownItems) {
+ ToolStripMenuItem menu = item as ToolStripMenuItem;
+ if (menu != null) {
+ bool exists = false;
+ // åãåå¨ãã¦ããããã§ãã¯ãå¤ãã¦ãããåé¤ããã
+ foreach (ColumnHeader header in packageListView.Columns) {
+ if (header.Tag == menu.Tag) {
+ exists = true;
+ if (sortcolumn == header) {
+ packageListView.SortColumn = sortcolumn = null;
+ }
+ if (menu.Checked == false) {
+ packageListView.Columns.Remove(header);
+ }
+ break;
+ }
+ }
+
+ // åãåå¨ãã¦ããªãããã§ãã¯ãããã¦ãããªã追å ããã
+ if (menu.Checked && !exists) {
+ ColumnHeader header = new ColumnHeader();
+ header.Text = menu.Text;
+ header.Tag = menu.Tag;
+ packageListView.Columns.Add(header);
+ }
}
-
- return pkgs.ToArray();
+ }
+
+ AppliStation.Util.NativeMethods.ColumnHeader_SetSortState(packageListView, (sortcolumn != null)? sortcolumn.Index : -1, SortOrder.None);
+
+ packageListView.UpdateItems();
+
+ packageListView.EndUpdate();
}
}