Changes between Version 3 and Version 4 of maestro/MaestroAPI/basics


Ignore:
Timestamp:
01/22/13 18:23:54 (12 years ago)
Author:
davidwilhelmsson
Comment:

Added syntax formatting

Legend:

Unmodified
Added
Removed
Modified
  • maestro/MaestroAPI/basics

    v3 v4  
    3434Both 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:
    3535{{{
     36#!text/x-csharp
    3637MaestroAPI.ServerConnectionI connection = new MaestroAPI.HttpServerConnection(url, sessionID, locale);
    3738}}}
    3839Note 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:
    3940{{{
     41#!text/x-csharp
    4042MaestroAPI.ServerConnectionI connection = MaestroAPI.ConnectionFactory.CreateHttpConnection(url, sessionID, locale, true);
    4143}}}
    4244Or, using the "generic" but more verbose way:
    4345{{{
     46#!text/x-csharp
    4447MaestroAPI.ServerConnectionI connection = MaestroAPI.ConnectionProviderRegistry.CreateConnection("Maestro.Http", "Url=" + url + ";SessionId=" + sessionID + ";Locale=" + locale + ";AllowUntestedVersion=true");
    4548}}}
     
    4750Once you have a connection instance, you can load and save resources:
    4851{{{
     52#!text/x-csharp
    4953MaestroAPI.MapDefintion mapDef = connection.GetMapDefinition(resourceId);
    5054mapDef.BackgroundColor = System.Drawing.Color.Yellow;
     
    6367Example usage for the runtime class is:
    6468{{{
     69#!text/x-csharp
    6570MaestroAPI.RuntimeClasses.RuntimeMap map = connection.GetRuntimeMap(resourceID);
    6671MaestroAPI.RuntimeClasses.RuntimeMapLayer layer = map.Layers[layername];