We have item template that works with it's wizard, our customer can use this item template to add custom item to the project that is created via our custom project template. In our item template wizard we will analyse the "Constants" class with CodeDom, this "Constants" class contains several Integer type constants (ex public const int MyConstant = 5), but the InitExpression of some constants are complex expression (ex 2 * Another Constant) not a simple value (ex 5) , how can we evaluate the Init value of those constants that with a complex InitExpression.
Sample Code.
Constants
{
public const int MyConstant1 = 5;
public const int MyConstant2 =10;
public const int MyConstant3 = MyConstant1 + MyConstant2;
}
How can we get the Init value (15) of MyConstant3 with CodeDom?
For MyConstant1 and MyConstant2, we just use the int.TryParse(CodeVariable.InitExpression.ToString(), initValue)
Thanks.