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




functionalityType
Determines whether a GIS resource supports a GIS functionality type.

Syntax

Visual Basic (Declaration) 
Function SupportsFunctionality( _
   ByVal functionalityType As Type _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As IGISResource
Dim functionalityType As Type
Dim value As Boolean
 
value = instance.SupportsFunctionality(functionalityType)
C# 
bool SupportsFunctionality( 
   Type functionalityType
)

Parameters

functionalityType

Return Value

Whether the functionality is supported

Example

At runtime, use SupportsFunctionality to determine if a GIS resource can create a GIS functionality. The example assumes a Map control named Map1 is available and contains at least one map resource.
C#Copy Code
IGISFunctionality mf =  

  (IGISFunctionality)Map1.GetFunctionality(resource_index); 

IGISResource gisresource = mf.Resource; 

bool supported =  

  gisresource.SupportsFunctionality(typeof(IQueryFunctionality)); 

    
When implementing IGISResource, define an explicit list of functionality types supported.
C#Copy Code
public bool SupportsFunctionality(System.Type functionalityType) 



    if (functionalityType ==  

      typeof(ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality)) return true; 

    else if (functionalityType ==  

      typeof(ESRI.ArcGIS.ADF.Web.DataSources.IMapTocFunctionality)) return true; 

    else if (functionalityType ==   

      typeof(ESRI.ArcGIS.ADF.Web.DataSources.IQueryFunctionality)) return true; 

    else return false; 



    

See Also

© 2010 All Rights Reserved.