The Resource Object Model
Overview Unlike the official MapGuide API, all resources in the Maestro API are strongly-typed objects and not blobs of arbitrary XML content that needs to be manually processed and manipulated by your application. All XML resource elements are represented as classes. These classes are automatically generated from the respective XSD used to validate this resource content. Because a resource can have many different schema versions, these classes implement a set of common interfaces that reside under the OSGeo.MapGuide.ObjectModels namespace. This has 2 benefits: It prevents collision of the autogenerated classes across different versions. The generated classes are partitioned under internal version-specific namespaces By working against the resource interfaces, your code can work with any supported schema version of a given resource. In addition, adding support for newer schema revisions requires no changes on your side When working with the Maestro API, always write code against the resource interfaces. Despite being public types and included in the Maestro API assemblies, never write code against the autogenerated classes because multiple versions of them exist. It is for this reason that the autogenerated classes are not included in this API documentation.
Resource Interface Versions Each schema revision introduces new elements, which require new resource interfaces in the Maestro API that map to these new elements. In such cases, we adopt the approach of COM interfaces and create a new interface that extends the old one and incorporates the methods and properties to handle the new elements. The new interface is suffixed with a number that increases with each new schema revision For example, the T:OSGeo.MapGuide.ObjectModels.WebLayout.IWebLayout interface represents the Web Layout resource (version 1.0.0). The 1.1.0 schema introduces a new PingServer element (to prevent viewer session expiry). To tap into this newly exposed element provided by this schema, a T:OSGeo.MapGuide.ObjectModels.WebLayout.IWebLayout2 interface included, which extends the original T:OSGeo.MapGuide.ObjectModels.WebLayout.IWebLayout interface and includes the new P:OSGeo.MapGuide.ObjectModels.WebLayout.IWebLayout2.EnablePingServer property. All other resource interfaces follow the same pattern of design. Of course, due to the large number of schema revisions made since the very first release of MapGuide Open Source, it is a bit difficult to keep track of all the relevant schema revisions and the resource interfaces that are affected. The following table shows which resource schema versions a newer resource interface is applicable to: Resource Type Interfaces introduced for this version (also applicable for versions after it) Layer Definition (v1.1.0) T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IVectorScaleRange2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ICompositeTypeStyle, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ICompositeRule, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IStroke2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ElevationTypeType, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IElevationSettings, T:OSGeo.MapGuide.ObjectModels.SymbolDefinition.ISymbolInstance, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ICompositeSymbolization, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IParameterOverride, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IParameterOverrideCollection Layer Definition (v1.2.0) T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ISymbolInstance2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IParameterOverride2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IThemeLabel, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.UsageContextType, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.GeometryContextType Layer Definition (v1.3.0) T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ICompositeTypeStyle2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IAreaVectorStyle2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ILineVectorStyle2, T:OSGeo.MapGuide.ObjectModels.LayerDefinition.IPointVectorStyle2 Layer Definition (v2.3.0) T:OSGeo.MapGuide.ObjectModels.LayerDefinition.ISubLayerDefinition2 Map Definition (v2.3.0) T:OSGeo.MapGuide.ObjectModels.MapDefinition.IMapDefinition2 Web Layout (v1.1.0) T:OSGeo.MapGuide.ObjectModels.WebLayout.IWebLayout2 Symbol Definition (v1.1.0) T:OSGeo.MapGuide.ObjectModels.SymbolDefinition.ITextGraphic2, T:OSGeo.MapGuide.ObjectModels.SymbolDefinition.DataType2
To determine whether a given interface is accessible, you can either check the P:OSGeo.MapGuide.MaestroAPI.Resource.IVersionedEntity.ResourceVersion and refer to this table to see if these interfaces can be casted from their older versions. Or you can utilise language features such as C#'s