[mapguide-users] How to get propertytypes of items in featureclass

Gunter Becker gunter.becker at csogis.de
Mon Oct 26 05:00:03 EDT 2009


Sorry,

return value must be of type int

int dataType = ((MgDataPropertyDefinition)propDef).DataType;



Gunter Becker wrote:
> 
> OK,
> 
> after hours of searching and posting my problem I got at last the idea to
> look in the Web API and found the answer to my question. Wow!
> 
> The value 100 meens that the propertytype is of type
> "MgDataPropertyDefinition" (102 - "MgGeometricPropertyDefinition"). So I
> just have to cast it in the right type and then use the "DataType"
> property of this class:
> 
> short dataType = ((MgDataPropertyDefinition)propDef).DataType;
> 
> Sorry for making trouble,
> Gunter
> 
> 
> Gunter Becker wrote:
>> 
>> Hi,
>> 
>> I would like to get all the propertytypes of the propertyitems in a
>> feature class. What is the best way to do this.
>> 
>> I already tried this:
>> 
>> MgClassDefinition classDef =
>> _featureService.GetClassDefinition(featureSource, schema, featureClass);
>> 
>> MgPropertyDefinitionCollection propertiesDef = classDef.GetProperties();
>> MgPropertyDefinition propDef = propertiesDef.GetItem(0); // just request
>> one index for test
>> short propType = propDef.GetPropertyType();
>> 
>> But propType always seems to have the value 100 (except GeometryColumn:
>> 102). I would except that this propertytype is of type MgPropertyType
>> which should return the right type. It is the same like in thread 
>> 
>> http://n2.nabble.com/Managed-MgPropertyDefinition-GetPropertyType-broken-td1821496.html#a1821496
>> Managed MgPropertyDefinition.GetPropertyType - broken? 
>> But I can't figure out what I'm doing wrong.
>> 
>> So what other solutions are there to get the right proprtytypes?
>> 
>> Thanks, Gunter
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-get-propertytypes-of-items-in-featureclass-tp3890750p3890856.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list