[mapguide-commits] r8762 - in trunk/Tools/Maestro: OSGeo.MapGuide.MaestroAPI.Native ProviderTemplate

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Sep 23 03:54:16 PDT 2015


Author: jng
Date: 2015-09-23 03:54:16 -0700 (Wed, 23 Sep 2015)
New Revision: 8762

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
   trunk/Tools/Maestro/ProviderTemplate/Form1.cs
Log:
#2571: Fix use of APIs that have been removed in MGOS 3.0

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2015-09-22 15:52:57 UTC (rev 8761)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2015-09-23 10:54:16 UTC (rev 8762)
@@ -565,8 +565,8 @@
 
             GetByteReaderMethod fetch = () =>
             {
-                MgMap m = new MgMap();
-                m.Open(res, mapname);
+                MgMap m = new MgMap(m_con);
+                m.Open(mapname);
                 MgSelection sel = new MgSelection(m);
                 //The color accepted by MgColor has alpha as the last value, but the returned has alpha first
                 MgColor color = new MgColor(Utility.ParseHTMLColor(m.GetBackgroundColor()));
@@ -590,8 +590,8 @@
 
             GetByteReaderMethod fetch = () =>
             {
-                MgMap m = new MgMap();
-                m.Open(res, mapname);
+                MgMap m = new MgMap(m_con);
+                m.Open(mapname);
                 MgSelection sel = new MgSelection(m);
                 //The color accepted by MgColor has alpha as the last value, but the returned has alpha first
                 MgColor color = new MgColor(Utility.ParseHTMLColor(m.GetBackgroundColor()));
@@ -608,8 +608,8 @@
             MgRenderingService rnd = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
             MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
 
-            MgMap mmap = new MgMap();
-            mmap.Open(res, map.Name);
+            MgMap mmap = new MgMap(m_con);
+            mmap.Open(map.Name);
             MgSelection sel = new MgSelection(mmap);
             if (selection != null)
                 sel.FromXml(selection.ToXml());
@@ -631,8 +631,8 @@
 
             GetByteReaderMethod fetch = () =>
             {
-                MgMap mmap = new MgMap();
-                mmap.Open(res, map.Name);
+                MgMap mmap = new MgMap(m_con);
+                mmap.Open(map.Name);
                 MgSelection sel = new MgSelection(mmap);
                 if (selection != null)
                     sel.FromXml(selection.ToXml());
@@ -650,8 +650,8 @@
 
             GetByteReaderMethod fetch = () =>
             {
-                MgMap mmap = new MgMap();
-                mmap.Open(res, map.Name);
+                MgMap mmap = new MgMap(m_con);
+                mmap.Open(map.Name);
                 MgSelection sel = new MgSelection(mmap);
                 MgColor color = new MgColor(backgroundColor);
                 return rnd.RenderMapLegend(mmap, width, height, color, format);
@@ -1318,9 +1318,9 @@
             string runtimeMapName = rtMap.Name;
             MgRenderingService rs = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
             MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
-            MgMap map = new MgMap();
+            MgMap map = new MgMap(m_con);
             string mapname = runtimeMapName.IndexOf(":") > 0 ? new ResourceIdentifier(runtimeMapName).Path : runtimeMapName;
-            map.Open(res, mapname);
+            map.Open(mapname);
 
             MgWktReaderWriter r = new MgWktReaderWriter();
             MgStringCollection layerNames = null;

Modified: trunk/Tools/Maestro/ProviderTemplate/Form1.cs
===================================================================
--- trunk/Tools/Maestro/ProviderTemplate/Form1.cs	2015-09-22 15:52:57 UTC (rev 8761)
+++ trunk/Tools/Maestro/ProviderTemplate/Form1.cs	2015-09-23 10:54:16 UTC (rev 8762)
@@ -2,6 +2,7 @@
 using Microsoft.CodeAnalysis.CSharp;
 using System;
 using System.Collections.Generic;
+using System.Collections.Immutable;
 using System.ComponentModel;
 using System.Diagnostics;
 using System.IO;
@@ -82,7 +83,7 @@
                 outputKind: OutputKind.DynamicallyLinkedLibrary,
                 platform: Platform.AnyCpu,
                 optimizationLevel: ba.DebugMode ? OptimizationLevel.Debug : OptimizationLevel.Release,
-                cryptoKeyFile: keyFile
+                strongNameProvider: new DesktopStrongNameProvider(ImmutableArray.Create(keyFile))
             );
             var comp = CSharpCompilation.Create(ba.AssemblyNameWithExtension, files, references, options);
             using (var fs = File.OpenWrite(Path.Combine(outputDir, ba.AssemblyNameWithExtension)))
@@ -297,8 +298,11 @@
         {
             using (var fp = new SaveFileDialog())
             {
-                File.WriteAllText(fp.FileName, txtMessages.Text);
-                MessageBox.Show($"Messages saved to {fp.FileName}");
+                if (fp.ShowDialog() == DialogResult.OK)
+                {
+                    File.WriteAllText(fp.FileName, txtMessages.Text);
+                    MessageBox.Show($"Messages saved to {fp.FileName}");
+                }
             }
         }
     }



More information about the mapguide-commits mailing list