The EfficiencyCommon.EfficiencySection object is one of the most important objects within EfficiencySpring. It is utilized for:
The EfficiencyCommon.EfficiencySection object is also readily inheritable into customized classes
The EfficiencySpringPage class, which is inherited into every EfficiencySpring web page, contains an instance of the EfficiencyCommonC.CoreObjectFactory class. This class contains an overloaded function called CreateNewSectionObject, which is used to instantiate a standard or customized version of the EfficiencySection class. The version of the function that accepts a SectionId redirects to the version of the function that accepts a Section URL; the latter is where customizations should be made. CreateNewSectionObject is utilized everywhere in the aspx codebase for creating EfficiencySpringSection objects, providing a central place for controlling what version of the EfficiencySection class is created.
The function is located in the CoreObjectFactory.vb file, and already contains an example of instantiating custom versions of the EfficiencySection object based on the passed in URL.
Below is an example of using the CreateNewSectionObject to instantiate a customized EfficiencySection object for the Blog section.
Public Overrides Function CreateNewSectionObject( _ ByVal SectionUrl As String, _ ByRef ActiveUser As EfficiencyCommon.Security.User, ByRef rpLocal As EfficiencyCommon.DatabaseAccess.ReaderProvider _ ) As EfficiencyCommon.EfficiencySection SectionUrl = SectionUrl.ToLower() If Right(SectionUrl, 1) <> "/" Then SectionUrl &= "/" End If Select Case SectionUrl.ToLower() Case "/r/blog/" Return New Section_Blog(Me) End Select Return MyBase.CreateNewSectionObject(SectionUrl, ActiveUser, rpLocal) End Function