using System; namespace Disco.Services.Plugins { public abstract class PluginWebViewPage : Web.WebViewPage { private Lazy> _plugin; public PluginManifest Manifest {get;private set;} public WebPageHelper Plugin { get { return _plugin.Value; } } public PluginWebViewPage() { var self = GetType(); Manifest = Plugins.GetPlugin(self.Assembly); _plugin = new Lazy>(() => { if (Context == null) throw new InvalidOperationException("The WebViewPage Context property is not initialized"); return new WebPageHelper(this, Manifest); }); } } }