ESRI.ArcGIS.ADF.Web.DataSources
CreateFunctionality Method
See Also  Example
ESRI.ArcGIS.ADF.Web.DataSources Namespace > IGISResource Interface : CreateFunctionality Method




functionalityType
functionalityName
Creates a GIS functionality using the type and name specified.

Syntax

Visual Basic (Declaration) 
Function CreateFunctionality( _
   ByVal functionalityType As Type, _
   ByVal functionalityName As String _
) As IGISFunctionality
Visual Basic (Usage)Copy Code
Dim instance As IGISResource
Dim functionalityType As Type
Dim functionalityName As String
Dim value As IGISFunctionality
 
value = instance.CreateFunctionality(functionalityType, functionalityName)
C# 
IGISFunctionality CreateFunctionality( 
   Type functionalityType,
   string functionalityName
)

Parameters

functionalityType
functionalityName

Return Value

The GIS functionality created by the GIS resource.

Example

At runtime, use the CreateFunctionality method to create a functionality to do some work. Often CreateFunctionality is used in conjunction with SupportsFunctionality to determine if a functionality can be created.
C#Copy Code
bool supported =  

  gisresource.SupportsFunctionality(typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)); 

  

if (supported) 



    ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality qfunc =  

      (ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality) 

      gisresource.CreateFunctionality(typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality), null); 



    
When implementing IGISResource, use the CreateFunctionality method to create and return the requested functionality type.
C#Copy Code
public IGISFunctionality CreateFunctionality(System.Type functionalityType, string functionalityName) 



    IGISFunctionality gisfunctionality = null; 

    if (functionalityType == typeof(ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality)) 

    { 

        gisfunctionality = new MapFunctionality(functionalityName, this); 

    } 

    else if (functionalityType == typeof(ESRI.ArcGIS.ADF.Web.DataSources.IMapTocFunctionality)) 

    { 

        gisfunctionality = new MapTocFunctionality(functionalityName, this); 

    } 

    else if (functionalityType == typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)) 

    { 

        gisfunctionality = new QueryFunctionality(functionalityName, this); 

    } 

    else 

    { 

        throw new ArgumentException("functionalityType not supported"); 

    } 

     

    return gisfunctionality; 



    

See Also

© 2010 All Rights Reserved.