IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
The next thing your definition class should do is provide 2 constructors: one empty constructor and another one which takes a single configuration element as an argument. This is the same configuration element that we will implement in the next step. Both constructors should invoke the constructors of the base class with corresponding signatures. They don’t need to execute any code. Sitefinity CMS uses these constructors to create instances of your classes, and they are invoked automatically.
public
CustomDefinition()
:
base
()
{
}
CustomDefinition(ConfigElement parent)
(parent)
After you have implemented the two constructors, you should of course implement all properties specified by your custom interface. Those properties should not use automatic getters and setters. Instead, they should resolve their values by calling the ResolveProperty method of the base class. This is very important and your definitions will not work if your properties do not resolve values like this. The ResolveProperty method is the entry point for the chain of responsibility pattern we described earlier.
string
CustomHeaderText
get
return
this
.ResolveProperty<
>(
"CustomHeaderText"
,
.customHeaderText);
set
.customHeaderText = value;
private
customHeaderText;
There are several arguments you should pass to the ResolveProperty method.
When you have the two constructors and all properties from the interface, the implementation of the definition class is done.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important