[mapguide-commits] r5662 - trunk/Tools/Maestro/Maestro.Base/UI
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Mar 28 06:41:30 EDT 2011
Author: jng
Date: 2011-03-28 03:41:30 -0700 (Mon, 28 Mar 2011)
New Revision: 5662
Modified:
trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs
Log:
#1642: Default with all categories selected and only start retaining previous selection when a template has been selected (ie. not cancelled)
Modified: trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs 2011-03-28 10:29:00 UTC (rev 5661)
+++ trunk/Tools/Maestro/Maestro.Base/UI/NewResourceDialog.cs 2011-03-28 10:41:30 UTC (rev 5662)
@@ -33,6 +33,7 @@
{
public partial class NewResourceDialog : Form
{
+ private static bool _subsequentRun = false;
private static List<string> _lastSelectedCategoies = new List<string>();
private NewResourceDialog()
@@ -56,10 +57,25 @@
{
lstCategories.DataSource = _nits.GetCategories();
- if (_lastSelectedCategoies.Count > 0)
+ if (_subsequentRun)
{
- foreach (var cat in _lastSelectedCategoies)
+ if (_lastSelectedCategoies.Count > 0)
{
+ foreach (var cat in _lastSelectedCategoies)
+ {
+ var idx = lstCategories.Items.IndexOf(cat);
+ if (idx >= 0)
+ {
+ lstCategories.SetSelected(idx, true);
+ }
+ }
+ }
+ }
+ else
+ {
+ //First run, select all categories
+ foreach (var cat in _nits.GetCategories())
+ {
var idx = lstCategories.Items.IndexOf(cat);
if (idx >= 0)
{
@@ -207,6 +223,9 @@
{
_lastSelectedCategoies.Add(item.ToString());
}
+
+ if (!_subsequentRun)
+ _subsequentRun = true;
}
private void lstTemplates_MouseDoubleClick(object sender, MouseEventArgs e)
More information about the mapguide-commits
mailing list