Exemplo n.º 1
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        public void ShowWinFormsOptionsUI()
        {
            using (var view = Factory.Resolve <IOptionsView>()) {
                var options = OptionsStorage.Load(this);

                view.WebSite  = _WebSite;
                view.SiteRoot = _SiteRoot;
                view.InjectSettings.AddRange(options.InjectSettings.Select(r => (InjectSettings)r.Clone()));
                view.PluginEnabled               = options.Enabled;
                view.SiteRootFolder              = options.SiteRootFolder;
                view.ResourceImagesFolder        = options.ResourceImagesFolder;
                view.DefaultInjectionFilesFolder = options.DefaultInjectionFilesFolder;

                if (view.DisplayView())
                {
                    options.InjectSettings.Clear();
                    options.InjectSettings.AddRange(view.InjectSettings);
                    options.Enabled                     = view.PluginEnabled;
                    options.SiteRootFolder              = view.SiteRootFolder;
                    options.ResourceImagesFolder        = view.ResourceImagesFolder;
                    options.DefaultInjectionFilesFolder = view.DefaultInjectionFilesFolder;

                    OptionsStorage.Save(this, options);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="parameters"></param>
        public void Startup(PluginStartupParameters parameters)
        {
            Singleton = this;
            _WebSite  = parameters.WebSite;

            var options = OptionsStorage.Load(this);

            ApplyOptions(options);

            var heartbeat = Factory.ResolveSingleton <IHeartbeatService>();

            heartbeat.SlowTick += Heartbeat_SlowTick;
        }