The user-defined class which holds the cell data is defined here:
public class CellData
{
private int row;
private int level;
private int column;
private string formula;
private object result;
private List
public int Row { get { return row; } set { row = value; } }
public int Column { get { return column; } set { column = value; } }
public int Level { get { return level; } set { level = value; } }
public string Formula { get { return formula; } set { formula = value; } }
public object Result { get { return result; } set { result = value; } }
public List
}
// Constructor
public CellData(int CellRow, int CellColumn, int CellLevel, string CellFormula)
{
row = CellRow;
column = CellColumn;
formula = CellFormula;
level = CellLevel;
children = new List
}
Since I needed the compiled CodeDom code to know what a CellData object was, I replicated that within the CodeDom code. The compiled code looks something like this:
using System;
using System.Collections;
using System.Collections.Generic;
namespace C_Tech_Programmer
{
public class Code
{
// Calculate all of the formulas
public List
{
calcList[0].Result = 7 * 7 * 9;
return calcList;
}
}
public class CellData
{
private int row;
private int level;
private int column;
private string formula;
private object result;
private List
public int Row { get { return row; } set { row = value; } }
public int Column { get { return column; } set { column = value; } }
public int Level { get { return level; } set { level = value; } }
public string Formula { get { return formula; } set { formula = value; } }
public object Result { get { return result; } set { result = value; } }
public List
}
// Constructor
public CellData(int CellRow, int CellColumn, int CellLevel, string CellFormula)
{
row = CellRow;
column = CellColumn;
formula = CellFormula;
level = CellLevel;
children = new List
}
}
}
To executed the compiled code, I pass my list of CellData objects to the Invoke method for the CodeDom code.
List
result = (List
The problem is that it won't make the conversion from the CellData class in my normal code to the CellData class in the CodeDom compiled code. This is the error that comes up:
{"Object of type 'System.Collections.Generic.List`1[C_Tech_Programmer.CellData]' cannot be converted to type 'System.Collections.Generic.List`1[C_Tech_Programmer.CellData]'."}
I have checked both classes over and they look exactly the same to me. If there is some sort of way to convert these, or even a better way to go about doing this, I would be much obliged to know how.
Thanks,
Dan
Replies
Know the answer? Post it — somebody with the same question will find it here.