Search Results for

    Show / Hide Table of Contents

    Class ObjectFactory

    Factory class to create MapGuide resource objects with either pre-defined or sensible default values. This is recommended over creating the objects directly as this ensures that there are no null child properties where the XML schema forbids it.

    By default this class will only create known versions of any top-level resource (as of writing, up to MapGuide Open Source 2.6 / AIMS 2015). In order to be able to create newer versions where support has not yet been added to this library, you will need to register the appropriate methods that can create resources of this version:

    • RegisterLayerFactoryMethod(Version, Func<LayerType, ILayerDefinition>) for Layer Definitions

    This registration needs to be done as part of your application's startup/initialization phase.

    Inheritance
    System.Object
    ObjectFactory
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: OSGeo.MapGuide.ObjectModels
    Assembly: OSGeo.MapGuide.ObjectModels.dll
    Syntax
    public static class ObjectFactory

    Methods

    | Improve this Doc View Source

    CreateAttributeRelation()

    Creates the attribute relation.

    Declaration
    public static IAttributeRelation CreateAttributeRelation()
    Returns
    Type Description
    IAttributeRelation
    | Improve this Doc View Source

    CreateCalculatedProperty()

    Creates the calculated property.

    Declaration
    public static ICalculatedProperty CreateCalculatedProperty()
    Returns
    Type Description
    ICalculatedProperty
    | Improve this Doc View Source

    CreateCalculatedProperty(String, String)

    Creates the calculated property.

    Declaration
    public static ICalculatedProperty CreateCalculatedProperty(string name, string expression)
    Parameters
    Type Name Description
    System.String name

    The name of the calculated property

    System.String expression

    The FDO Expression

    Returns
    Type Description
    ICalculatedProperty
    | Improve this Doc View Source

    CreateCompoundSymbol(Version, String, String)

    Creates the compound symbol.

    Declaration
    public static ICompoundSymbolDefinition CreateCompoundSymbol(Version version, string name, string description)
    Parameters
    Type Name Description
    System.Version version

    The version.

    System.String name

    The name.

    System.String description

    The description.

    Returns
    Type Description
    ICompoundSymbolDefinition
    | Improve this Doc View Source

    CreateDefaultLayer(LayerType, Version)

    Creates the default layer.

    Declaration
    public static ILayerDefinition CreateDefaultLayer(LayerType type, Version version)
    Parameters
    Type Name Description
    LayerType type

    The type.

    System.Version version

    The version.

    Returns
    Type Description
    ILayerDefinition
    | Improve this Doc View Source

    CreateDrawingSource()

    Creates the drawing source.

    Declaration
    public static IDrawingSource CreateDrawingSource()
    Returns
    Type Description
    IDrawingSource
    | Improve this Doc View Source

    CreateEnvelope(Double, Double, Double, Double)

    Creates an envelope (bounding box)

    Declaration
    public static IEnvelope CreateEnvelope(double minx, double miny, double maxx, double maxy)
    Parameters
    Type Name Description
    System.Double minx
    System.Double miny
    System.Double maxx
    System.Double maxy
    Returns
    Type Description
    IEnvelope
    | Improve this Doc View Source

    CreateFeatureSource(String)

    Creates the feature source.

    Declaration
    public static IFeatureSource CreateFeatureSource(string provider)
    Parameters
    Type Name Description
    System.String provider

    The provider.

    Returns
    Type Description
    IFeatureSource
    | Improve this Doc View Source

    CreateFeatureSource(String, NameValueCollection)

    Creates the feature source.

    Declaration
    public static IFeatureSource CreateFeatureSource(string provider, NameValueCollection values)
    Parameters
    Type Name Description
    System.String provider

    The provider.

    System.Collections.Specialized.NameValueCollection values

    The connection properties.

    Returns
    Type Description
    IFeatureSource
    | Improve this Doc View Source

    CreateFeatureSourceExtension()

    Creates the feature source extension.

    Declaration
    public static IFeatureSourceExtension CreateFeatureSourceExtension()
    Returns
    Type Description
    IFeatureSourceExtension
    | Improve this Doc View Source

    CreateFeatureSourceExtension(String, String)

    Creates the feature source extension.

    Declaration
    public static IFeatureSourceExtension CreateFeatureSourceExtension(string name, string featureClass)
    Parameters
    Type Name Description
    System.String name
    System.String featureClass
    Returns
    Type Description
    IFeatureSourceExtension
    | Improve this Doc View Source

    CreateFlexibleLayout(Version, IApplicationDefinitionTemplateInfoSet, IApplicationDefinitionWidgetInfoSet, IApplicationDefinitionContainerInfoSet, String, Boolean)

    Creates a fusion flexible layout

    Declaration
    public static IApplicationDefinition CreateFlexibleLayout(Version siteVersion, IApplicationDefinitionTemplateInfoSet templates, IApplicationDefinitionWidgetInfoSet widgets, IApplicationDefinitionContainerInfoSet containers, string templateName, bool statelessMode = false)
    Parameters
    Type Name Description
    System.Version siteVersion

    The site version

    IApplicationDefinitionTemplateInfoSet templates

    The set of available templates

    IApplicationDefinitionWidgetInfoSet widgets

    The set of available widgets

    IApplicationDefinitionContainerInfoSet containers

    The set of available containers

    System.String templateName

    The name of the template. See FusionTemplateNames for the common pre-defined names

    System.Boolean statelessMode

    If true, the widget set will only be populated with widgets that can work without a running MapGuide Server

    Returns
    Type Description
    IApplicationDefinition
    | Improve this Doc View Source

    CreateLoadProcedure(LoadType)

    Creates the load procedure.

    Declaration
    public static ILoadProcedure CreateLoadProcedure(LoadType type)
    Parameters
    Type Name Description
    LoadType type

    The type.

    Returns
    Type Description
    ILoadProcedure
    | Improve this Doc View Source

    CreateLoadProcedure(LoadType, IEnumerable<String>)

    Creates the load procedure.

    Declaration
    public static ILoadProcedure CreateLoadProcedure(LoadType type, IEnumerable<string> fileNames)
    Parameters
    Type Name Description
    LoadType type

    The type.

    System.Collections.Generic.IEnumerable<System.String> fileNames

    The file names.

    Returns
    Type Description
    ILoadProcedure
    | Improve this Doc View Source

    CreateMapDefinition(Version, String)

    Creates the map definition.

    Declaration
    public static IMapDefinition CreateMapDefinition(Version version, string name)
    Parameters
    Type Name Description
    System.Version version
    System.String name
    Returns
    Type Description
    IMapDefinition
    | Improve this Doc View Source

    CreateMapDefinition(Version, String, String)

    Creates the map definition.

    Declaration
    public static IMapDefinition CreateMapDefinition(Version ver, string name, string coordinateSystemWkt)
    Parameters
    Type Name Description
    System.Version ver
    System.String name
    System.String coordinateSystemWkt
    Returns
    Type Description
    IMapDefinition
    | Improve this Doc View Source

    CreateMapDefinition(Version, String, String, IEnvelope)

    Creates the map definition.

    Declaration
    public static IMapDefinition CreateMapDefinition(Version ver, string name, string coordinateSystemWkt, IEnvelope env)
    Parameters
    Type Name Description
    System.Version ver
    System.String name
    System.String coordinateSystemWkt
    IEnvelope env
    Returns
    Type Description
    IMapDefinition
    | Improve this Doc View Source

    CreateMetadata()

    Creates an empty resource document header metadata object

    Declaration
    public static ResourceDocumentHeaderTypeMetadata CreateMetadata()
    Returns
    Type Description
    ResourceDocumentHeaderTypeMetadata
    | Improve this Doc View Source

    CreatePoint2D(Double, Double)

    Creates a 2d point

    Declaration
    public static IPoint2D CreatePoint2D(double x, double y)
    Parameters
    Type Name Description
    System.Double x
    System.Double y
    Returns
    Type Description
    IPoint2D
    | Improve this Doc View Source

    CreatePoint3D(Double, Double, Double)

    Creates a 3d point

    Declaration
    public static IPoint3D CreatePoint3D(double x, double y, double z)
    Parameters
    Type Name Description
    System.Double x
    System.Double y
    System.Double z
    Returns
    Type Description
    IPoint3D
    | Improve this Doc View Source

    CreatePrintLayout()

    Creates the print layout.

    Declaration
    public static IPrintLayout CreatePrintLayout()
    Returns
    Type Description
    IPrintLayout
    | Improve this Doc View Source

    CreateSecurityGroup()

    Creates an empty group security object

    Declaration
    public static ResourceSecurityTypeGroups CreateSecurityGroup()
    Returns
    Type Description
    ResourceSecurityTypeGroups
    | Improve this Doc View Source

    CreateSecurityUser()

    Creates an empty user security object

    Declaration
    public static ResourceSecurityTypeUsers CreateSecurityUser()
    Returns
    Type Description
    ResourceSecurityTypeUsers
    | Improve this Doc View Source

    CreateSimpleLabel(Version, GeometryContextType)

    Creates a simple label symbol

    Declaration
    public static ISimpleSymbolDefinition CreateSimpleLabel(Version version, GeometryContextType type)
    Parameters
    Type Name Description
    System.Version version
    GeometryContextType type
    Returns
    Type Description
    ISimpleSymbolDefinition
    | Improve this Doc View Source

    CreateSimplePoint(Version)

    Declaration
    public static ISimpleSymbolDefinition CreateSimplePoint(Version version)
    Parameters
    Type Name Description
    System.Version version
    Returns
    Type Description
    ISimpleSymbolDefinition
    | Improve this Doc View Source

    CreateSimpleSolidFill(Version)

    Creates a simple solid fill symbol

    Declaration
    public static ISimpleSymbolDefinition CreateSimpleSolidFill(Version version)
    Parameters
    Type Name Description
    System.Version version
    Returns
    Type Description
    ISimpleSymbolDefinition
    | Improve this Doc View Source

    CreateSimpleSolidLine(Version)

    Creates a simple solid line symbol

    Declaration
    public static ISimpleSymbolDefinition CreateSimpleSolidLine(Version version)
    Parameters
    Type Name Description
    System.Version version
    Returns
    Type Description
    ISimpleSymbolDefinition
    | Improve this Doc View Source

    CreateSimpleSymbol(Version, String, String)

    Creates a simple symbol definition.

    Declaration
    public static ISimpleSymbolDefinition CreateSimpleSymbol(Version version, string name, string description)
    Parameters
    Type Name Description
    System.Version version

    The version.

    System.String name

    The name.

    System.String description

    The description.

    Returns
    Type Description
    ISimpleSymbolDefinition
    | Improve this Doc View Source

    CreateSymbolLibrary()

    Creates a new symbol library

    Declaration
    public static ISymbolLibrary CreateSymbolLibrary()
    Returns
    Type Description
    ISymbolLibrary
    | Improve this Doc View Source

    CreateTileSetDefinition(Version)

    Creates the tile set definition

    Declaration
    public static ITileSetDefinition CreateTileSetDefinition(Version version)
    Parameters
    Type Name Description
    System.Version version
    Returns
    Type Description
    ITileSetDefinition
    | Improve this Doc View Source

    CreateTileSetDefinition(Version, IEnvelope)

    Creates the tile set definition using the default provider

    Declaration
    public static ITileSetDefinition CreateTileSetDefinition(Version version, IEnvelope extents)
    Parameters
    Type Name Description
    System.Version version
    IEnvelope extents
    Returns
    Type Description
    ITileSetDefinition
    | Improve this Doc View Source

    CreateWatermark(SymbolDefinitionType, Version)

    Creates a Watermark Definition

    Declaration
    public static IWatermarkDefinition CreateWatermark(SymbolDefinitionType type, Version version)
    Parameters
    Type Name Description
    SymbolDefinitionType type
    System.Version version
    Returns
    Type Description
    IWatermarkDefinition
    | Improve this Doc View Source

    CreateWebLayout(Version, String)

    Creates the web layout.

    Declaration
    public static IWebLayout CreateWebLayout(Version version, string mapDefinitionId)
    Parameters
    Type Name Description
    System.Version version

    The version.

    System.String mapDefinitionId

    The map definition id.

    Returns
    Type Description
    IWebLayout
    | Improve this Doc View Source

    Deserialize(String, Stream)

    Deserializes the specified stream for the specified resource type.

    Declaration
    public static IResource Deserialize(string resourceType, Stream stream)
    Parameters
    Type Name Description
    System.String resourceType

    Type of the resource.

    System.IO.Stream stream

    The stream.

    Returns
    Type Description
    IResource
    | Improve this Doc View Source

    DeserializeEmbeddedFlexLayout(Version)

    Returns a deserialized copy of an embedded Flexible Layout

    Declaration
    public static IApplicationDefinition DeserializeEmbeddedFlexLayout(Version siteVersion)
    Parameters
    Type Name Description
    System.Version siteVersion
    Returns
    Type Description
    IApplicationDefinition
    | Improve this Doc View Source

    DeserializeXml(String)

    Deserializes the specified XML.

    Declaration
    public static IResource DeserializeXml(string xml)
    Parameters
    Type Name Description
    System.String xml

    The XML.

    Returns
    Type Description
    IResource
    | Improve this Doc View Source

    RegisterCompoundSymbolFactoryMethod(Version, Func<ICompoundSymbolDefinition>)

    Registers the compound symbol factory method

    Declaration
    public static void RegisterCompoundSymbolFactoryMethod(Version version, Func<ICompoundSymbolDefinition> func)
    Parameters
    Type Name Description
    System.Version version
    System.Func<ICompoundSymbolDefinition> func
    | Improve this Doc View Source

    RegisterLayerFactoryMethod(Version, Func<LayerType, ILayerDefinition>)

    Registers the layer factory method.

    Declaration
    public static void RegisterLayerFactoryMethod(Version version, Func<LayerType, ILayerDefinition> method)
    Parameters
    Type Name Description
    System.Version version

    The ver.

    System.Func<LayerType, ILayerDefinition> method

    The method.

    | Improve this Doc View Source

    RegisterLoadProcedureFactoryMethod(LoadType, Func<ILoadProcedure>)

    Registers the load procedure factory method.

    Declaration
    public static void RegisterLoadProcedureFactoryMethod(LoadType type, Func<ILoadProcedure> method)
    Parameters
    Type Name Description
    LoadType type

    The type.

    System.Func<ILoadProcedure> method

    The method.

    | Improve this Doc View Source

    RegisterMapDefinitionFactoryMethod(Version, Func<IMapDefinition>)

    Register the map definition factory method

    Declaration
    public static void RegisterMapDefinitionFactoryMethod(Version version, Func<IMapDefinition> method)
    Parameters
    Type Name Description
    System.Version version
    System.Func<IMapDefinition> method
    | Improve this Doc View Source

    RegisterResource(ResourceTypeDescriptor, ResourceSerializer)

    Registers a resource serializer

    Declaration
    public static void RegisterResource(ResourceTypeDescriptor desc, ResourceSerializer serializer)
    Parameters
    Type Name Description
    ResourceTypeDescriptor desc

    The desc.

    ResourceSerializer serializer

    The serializer.

    | Improve this Doc View Source

    RegisterResourceSerializer(ResourceTypeDescriptor, Func<IResource, Stream>, Func<String, IResource>)

    Registers a resource serializer

    Declaration
    public static void RegisterResourceSerializer(ResourceTypeDescriptor resourceType, Func<IResource, Stream> serializer, Func<string, IResource> deserializer)
    Parameters
    Type Name Description
    ResourceTypeDescriptor resourceType

    The resource type descriptor.

    System.Func<IResource, System.IO.Stream> serializer

    The serialize method.

    System.Func<System.String, IResource> deserializer

    The deserialize method.

    | Improve this Doc View Source

    RegisterSimpleSymbolFactoryMethod(Version, Func<ISimpleSymbolDefinition>)

    Regsiters the simple symbol factory method

    Declaration
    public static void RegisterSimpleSymbolFactoryMethod(Version version, Func<ISimpleSymbolDefinition> func)
    Parameters
    Type Name Description
    System.Version version
    System.Func<ISimpleSymbolDefinition> func
    | Improve this Doc View Source

    RegisterTileSetDefinitionFactoryMethod(Version, Func<ITileSetDefinition>)

    Registers the Tile Set Definition factory method

    Declaration
    public static void RegisterTileSetDefinitionFactoryMethod(Version version, Func<ITileSetDefinition> func)
    Parameters
    Type Name Description
    System.Version version
    System.Func<ITileSetDefinition> func
    | Improve this Doc View Source

    RegisterWatermarkDefinitionFactoryMethod(Version, Func<SymbolDefinitionType, IWatermarkDefinition>)

    Registers the Watermark Definition factory method

    Declaration
    public static void RegisterWatermarkDefinitionFactoryMethod(Version version, Func<SymbolDefinitionType, IWatermarkDefinition> method)
    Parameters
    Type Name Description
    System.Version version
    System.Func<SymbolDefinitionType, IWatermarkDefinition> method
    | Improve this Doc View Source

    RegisterWebLayoutFactoryMethod(Version, Func<String, IWebLayout>)

    Registers the web layout factory method.

    Declaration
    public static void RegisterWebLayoutFactoryMethod(Version version, Func<string, IWebLayout> method)
    Parameters
    Type Name Description
    System.Version version

    The version.

    System.Func<System.String, IWebLayout> method

    The method.

    | Improve this Doc View Source

    Reset()

    Resets the object factory by clearing all registered factories

    Declaration
    public static void Reset()
    | Improve this Doc View Source

    Serialize(IResource)

    Serializes the specified resource.

    Declaration
    public static Stream Serialize(IResource resource)
    Parameters
    Type Name Description
    IResource resource

    The resource.

    Returns
    Type Description
    System.IO.Stream
    | Improve this Doc View Source

    SerializeAsString(IResource)

    Serializes the specified resource.

    Declaration
    public static string SerializeAsString(IResource resource)
    Parameters
    Type Name Description
    IResource resource
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2009 - 2022 Jackie Ng