[mapserver-commits] r11081 - in trunk/mapserver: . mapscript/csharp mapscript/csharp/examples

svn at osgeo.org svn at osgeo.org
Sat Mar 5 12:44:17 EST 2011


Author: tamas
Date: 2011-03-05 09:44:17 -0800 (Sat, 05 Mar 2011)
New Revision: 11081

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapscript/csharp/csmodule.i
   trunk/mapserver/mapscript/csharp/examples/HTMLtemplate.cs
Log:
Add argument check for processTemplate, processLegendTemplate and processQueryTemplate in the C# bindings (#3699)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-03-05 16:41:32 UTC (rev 11080)
+++ trunk/mapserver/HISTORY.TXT	2011-03-05 17:44:17 UTC (rev 11081)
@@ -14,6 +14,9 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Add argument check for processTemplate, processLegendTemplate and 
+  processQueryTemplate in the C# bindings (#3699)
+
 - Remove shapeObj.line, shapeObj.values, lineObj.point from the SWIG API 
   which are redundant and undocumented. (#3269)
 

Modified: trunk/mapserver/mapscript/csharp/csmodule.i
===================================================================
--- trunk/mapserver/mapscript/csharp/csmodule.i	2011-03-05 16:41:32 UTC (rev 11080)
+++ trunk/mapserver/mapscript/csharp/csmodule.i	2011-03-05 17:44:17 UTC (rev 11081)
@@ -286,6 +286,34 @@
 %}
 
 
+%csmethodmodifiers processTemplate "private";
+%csmethodmodifiers processLegendTemplate "private";
+%csmethodmodifiers processQueryTemplate "private";
+
+%typemap(cscode) mapObj %{
+  public string processTemplate(int bGenerateImages, string[] names, string[] values)
+  {
+	if (names.Length != values.Length)
+	    throw new ArgumentException("Invalid array length specified!");
+	return processTemplate(bGenerateImages, names, values, values.Length);
+  }
+  
+  public string processLegendTemplate(string[] names, string[] values)
+  {
+	if (names.Length != values.Length)
+	    throw new ArgumentException("Invalid array length specified!");
+	return processLegendTemplate(names, values, values.Length);
+  }
+  
+  public string processQueryTemplate(string[] names, string[] values)
+  {
+	if (names.Length != values.Length)
+	    throw new ArgumentException("Invalid array length specified!");
+	return processQueryTemplate(names, values, values.Length);
+  }
+%}
+
+
 %typemap(ctype) gdBuffer    %{void%}
 %typemap(imtype) gdBuffer  %{void%}
 %typemap(cstype) gdBuffer %{byte[]%}

Modified: trunk/mapserver/mapscript/csharp/examples/HTMLtemplate.cs
===================================================================
--- trunk/mapserver/mapscript/csharp/examples/HTMLtemplate.cs	2011-03-05 16:41:32 UTC (rev 11080)
+++ trunk/mapserver/mapscript/csharp/examples/HTMLtemplate.cs	2011-03-05 17:44:17 UTC (rev 11081)
@@ -53,7 +53,7 @@
 		string[] names = null, values = null;
 		names = new string[] {"map"};
 		values = new string[] { args[0] };
-		str = map.processLegendTemplate(names, values, names.Length);
+		str = map.processLegendTemplate(names, values);
 		Console.Write(str);
     }
 }



More information about the mapserver-commits mailing list