Class ShellModule
Represents a module of the EPiServer Framework application
Inheritance
Inherited Members
Namespace: EPiServer.Shell.Modules
Assembly: EPiServer.Shell.dll
Version: 10.10.4Syntax
public class ShellModule
Constructors
ShellModule(String, String, String)
Initializes a new System.Reflection.Module instance.
Declaration
public ShellModule(string name, string routeBasePath, string resourceBasePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this module. |
System.String | routeBasePath | The initial path of mvc actions. |
System.String | resourceBasePath | The default location of resources such as aspx pages. |
ShellModule(String, String, String, ITypeScannerLookup, VirtualPathProvider)
Initializes a new System.Reflection.Module instance.
Declaration
public ShellModule(string name, string routeBasePath, string resourceBasePath, ITypeScannerLookup typeScannerLookup, VirtualPathProvider virtualPathProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of this module. |
System.String | routeBasePath | The initial path of mvc actions. |
System.String | resourceBasePath | The default location of resources such as aspx pages. |
ITypeScannerLookup | typeScannerLookup | The type scanner lookup. |
System.Web.Hosting.VirtualPathProvider | virtualPathProvider | The virtual path provider used for file system access. |
Properties
Assemblies
Assemblies associated with this module. These are the combination of dll files in the module's bin directory and assemblies configured in the module's manifest
Declaration
public IEnumerable<Assembly> Assemblies { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> |
ClientResourcePath
Gets or sets the client resource path.
Declaration
public string ClientResourcePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Controllers
Controllers associated with this module
Declaration
public IEnumerable<Type> Controllers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Type> |
Manifest
Describes the module. This information is de-serialized from a the file module.config located in the module directory.
Declaration
public ShellModuleManifest Manifest { get; set; }
Property Value
Type | Description |
---|---|
ShellModuleManifest |
Name
The name of the module, typically the same as the directory where the module is located.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ResourceBasePath
The path to the module directory. Views and client resources are located below this folder.
Declaration
public string ResourceBasePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RouteBasePath
An absolute path from which routes to this module are resolved. For instance "episerver/yourmodule/".
Declaration
public string RouteBasePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CreateViewModel(ModuleTable, IClientResourceService)
Creates the view module for this module.
Declaration
public virtual ModuleViewModel CreateViewModel(ModuleTable moduleTable, IClientResourceService clientResourceService)
Parameters
Type | Name | Description |
---|---|---|
ModuleTable | moduleTable | The module table. |
IClientResourceService | clientResourceService | The client resource service. |
Returns
Type | Description |
---|---|
ModuleViewModel | An object that will be serialized and sent to the client when initializing a view. |
Equals(Object)
Determines whether the specified System.Object is equal to the current System.Object. The comparison is made on the Name property.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current System.Object; otherwise, false. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetControllerType(String)
Gets a controller type by the controller name.
Declaration
public Type GetControllerType(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | Name of the controller. |
Returns
Type | Description |
---|---|
System.Type | A type if a matching controller is fount; otherwise null |
GetHashCode()
Serves as a hash function for a particular type. Will use the Name property to generate the hash code.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current System.Object. |
Overrides
GetHelpUrl()
Get the webhelp url for this module
Declaration
public virtual string GetHelpUrl()
Returns
Type | Description |
---|---|
System.String | A string containing the webhelp url |
GetResolvedRouteBasePath()
Gets the resolved route base path.
Declaration
public string GetResolvedRouteBasePath()
Returns
Type | Description |
---|---|
System.String | A path in a format that is absolute and includes a virtual directory path if present. For instance "/localhost/mysite/episerver/mymodule". |
GetRouteForController(String)
Gets the route for the given controller name.
Declaration
public RouteDescription GetRouteForController(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | The controller name |
Returns
Type | Description |
---|---|
RouteDescription | The route for the controller or null |
GetRouteSegmentForController(String)
Gets the route segement used for creating URLs; taking into account the route prefix.
Declaration
public string GetRouteSegmentForController(string controllerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controllerName | The controller name |
Returns
Type | Description |
---|---|
System.String | The route segement |
Examples
For "FooController" it will return "Foo".
Merge(ShellModule)
Declaration
public void Merge(ShellModule module)
Parameters
Type | Name | Description |
---|---|---|
ShellModule | module |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException |
MergeDuplicateModules(IEnumerable<ShellModule>)
Merges duplicate modules in the specified modules list list
Declaration
public static IEnumerable<ShellModule> MergeDuplicateModules(IEnumerable<ShellModule> modules)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ShellModule> | modules |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ShellModule> |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException |
ResolveClientPath(String)
Resolves the client path.
Declaration
[Obsolete("Use ModuleTable.ResolveClientPath instead", false)]
public string ResolveClientPath(string moduleRelativePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | moduleRelativePath | The module relative path. |
Returns
Type | Description |
---|---|
System.String | An absolut path to the client resource. |
ToString()
Returns a System.String that represents the current System.Object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents the current System.Object. |