Changes between Version 3 and Version 4 of maestro/MaestroAPI/basics
- Timestamp:
- 01/22/13 18:23:54 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
maestro/MaestroAPI/basics
v3 v4 34 34 Both connection classes implement the interface !MapGuideAPI.ServerConnectionI, so if you only declare your connection to be of this type, you can change connection type as you please: 35 35 {{{ 36 #!text/x-csharp 36 37 MaestroAPI.ServerConnectionI connection = new MaestroAPI.HttpServerConnection(url, sessionID, locale); 37 38 }}} 38 39 Note that the above method is deprecated for releases after 2.0 and will be eventually removed. The recommended way to create a connection for releases after 2.0 is as follows: 39 40 {{{ 41 #!text/x-csharp 40 42 MaestroAPI.ServerConnectionI connection = MaestroAPI.ConnectionFactory.CreateHttpConnection(url, sessionID, locale, true); 41 43 }}} 42 44 Or, using the "generic" but more verbose way: 43 45 {{{ 46 #!text/x-csharp 44 47 MaestroAPI.ServerConnectionI connection = MaestroAPI.ConnectionProviderRegistry.CreateConnection("Maestro.Http", "Url=" + url + ";SessionId=" + sessionID + ";Locale=" + locale + ";AllowUntestedVersion=true"); 45 48 }}} … … 47 50 Once you have a connection instance, you can load and save resources: 48 51 {{{ 52 #!text/x-csharp 49 53 MaestroAPI.MapDefintion mapDef = connection.GetMapDefinition(resourceId); 50 54 mapDef.BackgroundColor = System.Drawing.Color.Yellow; … … 63 67 Example usage for the runtime class is: 64 68 {{{ 69 #!text/x-csharp 65 70 MaestroAPI.RuntimeClasses.RuntimeMap map = connection.GetRuntimeMap(resourceID); 66 71 MaestroAPI.RuntimeClasses.RuntimeMapLayer layer = map.Layers[layername];