admin管理员组

文章数量:1313251

I have a jagged array created from a XSD. The type is:

object[][][] myobject;

Using CodeDom, I want to create some functions and one returns an instance of this object, something like:

object[][] MyItem(int num)=> myobject[num];

But I can't get that type using the CodeDom functions. Though if it was a simple array, like:

object[] myobject;

I could use

CodeTypeReference.BaseType

And I would get

object MyObject(int num)=>myobject[num];

Unfortunately BaseType is specified as follows:

This property contains the name of the type unless it is an array type, in which case it is the array element type.

Note The name of the property may be misleading. This property contains just the type name with any array adornments or generic type arguments removed, not the base or parent type as might be expected. For example, the BaseType value for System.Collections.Generic.Dictionary2[[System.String], [System.Collections.Generic.List1[[System.Int32]]]] is System.Collections.Generic.Dictionary`2.

Is it possible in the case of a jagged array to get the real base type which would be in my case?

object[][]

本文标签: cCodeDOm and jagged arrayStack Overflow