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