[mapguide-commits] r4425 - in trunk/Tools/Maestro/Maestro/ResourceEditors: . Strings

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Dec 12 05:59:59 EST 2009


Author: ksgeograf
Date: 2009-12-12 05:59:57 -0500 (Sat, 12 Dec 2009)
New Revision: 4425

Modified:
   trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs
   trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.Designer.cs
   trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.resx
Log:
Maestro:
Fixed issue #1178.

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs	2009-12-12 10:38:39 UTC (rev 4424)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/CoordinateSystemOverride.cs	2009-12-12 10:59:57 UTC (rev 4425)
@@ -521,11 +521,36 @@
                     if (m_item.CurrentConnection == null)
                         m_item.CurrentConnection = m_editor.CurrentConnection;
 
+
+                    SpatialContextTypeCollection tmp = m_item.SupplementalSpatialContextInfo;
+                    try
+                    {
+
+                        //This is always a copy, so saving is always safe
+                        m_item.SupplementalSpatialContextInfo.Clear();
+                        m_editor.CurrentConnection.SaveResource(m_item);
+                    }
+                    finally
+                    {
+                        m_item.SupplementalSpatialContextInfo = tmp;
+                    }
+
                     FdoSpatialContextList lst = m_item.GetSpatialInfo();
-                    if (lst.SpatialContext.Count > 0)
-                        SourceCoordinateSystem.Text = lst.SpatialContext[0].Name;
-                    else
-                        SourceCoordinateSystem.Text = "Default";
+
+                    string sourceCoordsys = lst.SpatialContext.Count > 0 ? lst.SpatialContext[0].Name : "Default";
+                    string targetCoordsys = lst.SpatialContext.Count > 0 ? lst.SpatialContext[0].CoordinateSystemWkt : TargetCoordinateSystem.Text;
+
+                    DialogResult res = DialogResult.Yes;
+                    if (TargetCoordinateSystem.Text.Trim().Length != 0 && TargetCoordinateSystem.Text != lst.SpatialContext[0].CoordinateSystemWkt)
+                    {
+                        res = MessageBox.Show(this, Strings.CoordinateSystemOverride.ResetOverrideQuestion, Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
+                        if (res == DialogResult.Cancel)
+                            return;
+                    }
+                   
+                    SourceCoordinateSystem.Text = lst.SpatialContext[0].Name;
+                    if (res == DialogResult.Yes)
+                        TargetCoordinateSystem.Text = lst.SpatialContext[0].CoordinateSystemWkt;
                 }
                 catch (Exception ex)
                 {

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.Designer.cs	2009-12-12 10:38:39 UTC (rev 4424)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.Designer.cs	2009-12-12 10:59:57 UTC (rev 4425)
@@ -80,6 +80,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to Do you also want to reset your overriden coordinate system with the one found in the spatial content?.
+        /// </summary>
+        internal static string ResetOverrideQuestion {
+            get {
+                return ResourceManager.GetString("ResetOverrideQuestion", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Null content in spatial info.
         /// </summary>
         internal static string SpatialContentNullError {

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.resx
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.resx	2009-12-12 10:38:39 UTC (rev 4424)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/Strings/CoordinateSystemOverride.resx	2009-12-12 10:59:57 UTC (rev 4425)
@@ -126,6 +126,10 @@
 are you sure you want to remove the other projections?</value>
     <comment>A confirmation message that is displayed when the user switches to simple mode, and that may cause loss of data</comment>
   </data>
+  <data name="ResetOverrideQuestion" xml:space="preserve">
+    <value>Do you also want to reset your overriden coordinate system with the one found in the spatial content?</value>
+    <comment>A question displayed if the spatial content reports a different coordinate system than the existing</comment>
+  </data>
   <data name="SpatialContentNullError" xml:space="preserve">
     <value>Null content in spatial info</value>
     <comment>An error message that is displayed if the spatial content for the resource returns null</comment>



More information about the mapguide-commits mailing list