Plugin features
An Embedded plugins is basically an assembly that encapsulates all views, controllers and static resources. It has to define the following:
- Embedded File systems containing the static resources
- Assembly that contains webparts such as views and controllers
- Specifying is a separate Embedded View engine is needed to be used by the views of this plugin.
The following is the Interface definition:
public interface IEmbeddedPlugin { Assembly WebPartsAssembly { get; } IFileProvider FileProvider {get;} bool InsertOwnEmbeddedViewEngine { get; } string OwnEmbeddedViewEnginePrefix { get; } }
Plugin implementation
Implementation of the interface can follow a quite easy pattern, defining file provider and assembly based on the current one:
public class SamplesViewEnginePlugin : IEmbeddedPlugin { public IFileProvider FileProvider => new EV5EmbeddedFileProvider(typeof(SamplesViewEnginePlugin).Assembly, "EV5.VE-"); public bool InsertOwnEmbeddedViewEngine => true; public string OwnEmbeddedViewEnginePrefix => "EV5"; public Assembly WebPartsAssembly => this.GetType().Assembly; }