字段初始值设定项不能引用非静态字段方法
// Create MyClass object
DatePickerDisigner objDatePicker = new DatePickerDisigner();
// Get the Type information.
Type myTypeObj = objDatePicker.GetType();
// Get Method Information.
MethodInfo myMethodInfo = myTypeObj.GetMethod("AddViews");
//Defining the parameter
object[] mParam = new object[] { 5, 10 };
// Invoking the method
myMethodInfo.Invoke(myClassObj, mParam);
*我在获取对象类型时遇到错误。 任何人都可以帮助我。
namespace SitefinityWebApp.Corticon.FormControls.ChoiceFieldDesigner
{
public class DatePickerDisigner : FormTextBoxDesigner
{
protected override string ScriptDescriptorTypeName
{
get
{
return typeof(ContentViewDesignerBase).FullName;
}
}
protected override void AddViews(Dictionary<string, ControlDesignerView> views)
{
base.AddViews(views);
var corticonView = new CorticonView();
views.Add(corticonView.ViewName, corticonView);
}
}
}