On Tue, Jan 25, 2011 at 10:02 PM, impworks <[email protected]> wrote: > I want my generated program to be able to call that function. > The problem is, when the function above is compiled by C# compiler, > the double[,] notation above is interpreted as double[0...,0...]. > So, I need to somehow get a System.Type representing that > double[0...,0...] so that I can retrieve the constructor and Set > method from it, which will be called later. > > Could you show me an example of calling that method? > > I tried creating that type with the following: > * typeof(double[,]) - failed obviously > * typeof(double).MakeArrayType(2) > * Array.CreateInstance(typeof(float), new[] { 5, 5 }, new[] { 0, > 0 }).GetType() - still no luck > * traversing the type's methods and importing the most appropriate one
It's a known issue that System.Type doesn't know how to represent bounds for an array type. As they are not represented, Cecil can only import what SR exposes: ranks. It's for instance usually impossible to override a method with a MD array parameter type with SRE. You need to use the Cecil representation of those methods as a source for import. Jb -- -- mono-cecil
