[mapguide-commits] r4472 - trunk/Tools/Maestro/Maestro

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Dec 24 06:19:01 EST 2009


Author: ksgeograf
Date: 2009-12-24 06:19:00 -0500 (Thu, 24 Dec 2009)
New Revision: 4472

Modified:
   trunk/Tools/Maestro/Maestro/BrowseUnmanagedData.cs
   trunk/Tools/Maestro/Maestro/EditorInterface.cs
   trunk/Tools/Maestro/Maestro/FormMain.cs
Log:
Maestro:
Fixed a cosmetic issue with the resource name in the validator.

Modified: trunk/Tools/Maestro/Maestro/BrowseUnmanagedData.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/BrowseUnmanagedData.cs	2009-12-24 11:02:34 UTC (rev 4471)
+++ trunk/Tools/Maestro/Maestro/BrowseUnmanagedData.cs	2009-12-24 11:19:00 UTC (rev 4472)
@@ -31,7 +31,7 @@
 	/// </summary>
 	public class BrowseUnmanagedData : System.Windows.Forms.Form
 	{
-		private new System.Windows.Forms.Button CancelBtn;
+		private System.Windows.Forms.Button CancelBtn;
 		private System.Windows.Forms.Button OKButton;
 		private System.Windows.Forms.Panel panel1;
 		private System.Windows.Forms.Panel panel3;

Modified: trunk/Tools/Maestro/Maestro/EditorInterface.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/EditorInterface.cs	2009-12-24 11:02:34 UTC (rev 4471)
+++ trunk/Tools/Maestro/Maestro/EditorInterface.cs	2009-12-24 11:19:00 UTC (rev 4472)
@@ -95,11 +95,6 @@
 			get { return m_page; }
 		}
 
-		public string ResourceID
-		{
-			get { return m_resourceID; }
-		}
-
         public string BrowseResource(string itemType)
         {
             string[] tmp = BrowseResource(new string[] { itemType }, false);

Modified: trunk/Tools/Maestro/Maestro/FormMain.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/FormMain.cs	2009-12-24 11:02:34 UTC (rev 4471)
+++ trunk/Tools/Maestro/Maestro/FormMain.cs	2009-12-24 11:19:00 UTC (rev 4472)
@@ -1229,7 +1229,7 @@
 			uc.Width = tp.Width - 32;
 			uc.Height = tp.Height - 32;
 			uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
-			m_userControls.Add(edi.ResourceID, edi);
+			m_userControls.Add(edi.ResourceId, edi);
 			tabItems.TabPages.Add(tp);
 			return edi;
 		}
@@ -1699,7 +1699,7 @@
                         //If we save under a different name, reload the parent folder
                         try
                         {
-                            TreeNode c = FindItem(edi.ResourceID, true);
+                            TreeNode c = FindItem(edi.ResourceId, true);
                             if (c == null || c.Parent == null)
                                 RebuildDocumentTree(); //TODO: If the node is not open, skip the refresh
                             else
@@ -1723,7 +1723,7 @@
 				if (edi.Page == tabItems.SelectedTab)
 				{
 					object resource = ((IResourceEditorControl)edi.Page.Controls[0]).Resource;
-                    ResourceEditors.XmlEditor dlg = new ResourceEditors.XmlEditor(resource, edi.ResourceID, edi);
+                    ResourceEditors.XmlEditor dlg = new ResourceEditors.XmlEditor(resource, edi.ResourceId, edi);
 					if (dlg.ShowDialog() == DialogResult.OK)
 					{
 						object o = dlg.SerializedObject;
@@ -2534,23 +2534,34 @@
                 if (ei == null || ei.Resource == null)
                     return;
 
-
                 if (ei.ValidateResource(true))
                 {
                     System.Reflection.PropertyInfo pi = ei.Resource.GetType().GetProperty("CurrentConnection");
                     if (pi != null && pi.CanWrite)
                         pi.SetValue(ei.Resource, this.CurrentConnection, null);
+                    try
+                    {
+                        pi = ei.Resource.GetType().GetProperty("ResourceId");
+                        if (pi != null && pi.CanWrite)
+                            pi.SetValue(ei.Resource, edi.ResourceId, null);
 
-                    ResourceEditors.WaitForOperation wdlg = new ResourceEditors.WaitForOperation();
-                    wdlg.CancelAbortsThread = true;
+                        ResourceEditors.WaitForOperation wdlg = new ResourceEditors.WaitForOperation();
+                        wdlg.CancelAbortsThread = true;
 
-                    ResourceValidators.ValidationIssue[] issues = (ResourceValidators.ValidationIssue[])wdlg.RunOperationAsync(this, new ResourceEditors.WaitForOperation.DoBackgroundWork(ValidateBackgroundRunner), ei.Resource);
-                    if (issues.Length == 0)
-                        MessageBox.Show(this, Strings.FormMain.NoValidationProblems, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
-                    else
+                        ResourceValidators.ValidationIssue[] issues = (ResourceValidators.ValidationIssue[])wdlg.RunOperationAsync(this, new ResourceEditors.WaitForOperation.DoBackgroundWork(ValidateBackgroundRunner), ei.Resource);
+                        if (issues.Length == 0)
+                            MessageBox.Show(this, Strings.FormMain.NoValidationProblems, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+                        else
+                        {
+                            ValidationResults dlg = new ValidationResults(ei.ResourceId, issues);
+                            dlg.ShowDialog(this);
+                        }
+                    }
+                    finally
                     {
-                        ValidationResults dlg = new ValidationResults(ei.ResourceId, issues);
-                        dlg.ShowDialog(this);
+                        pi = ei.Resource.GetType().GetProperty("ResourceId");
+                        if (pi != null && pi.CanWrite)
+                            pi.SetValue(ei.Resource, edi.TempResourceId, null);
                     }
                 }
 



More information about the mapguide-commits mailing list