Esempio n. 1
0
        /// <summary>Initializes a new instance of the NServiceKit.Razor.Managers.RazorPageResolver class.</summary>
        ///
        /// <param name="config">     The configuration.</param>
        /// <param name="viewManager">Manager for view.</param>
        public RazorPageResolver(IRazorConfig config, RazorViewManager viewManager)
        {
            this.RequestName = "Razor_PageResolver";

            this.config = config;
            this.viewManager = viewManager;
        }
Esempio n. 2
0
        /// <summary>Initializes a new instance of the NServiceKit.Razor.Managers.RazorPageResolver class.</summary>
        ///
        /// <param name="config">     The configuration.</param>
        /// <param name="viewManager">Manager for view.</param>
        public RazorPageResolver(IRazorConfig config, RazorViewManager viewManager)
        {
            this.RequestName = "Razor_PageResolver";

            this.config      = config;
            this.viewManager = viewManager;
        }
 /// <summary>Initializes a new instance of the NServiceKit.Razor.Managers.FileSystemWatcherLiveReload class.</summary>
 ///
 /// <param name="views">The views.</param>
 public FileSystemWatcherLiveReload(RazorViewManager views)
 {
     this.views = views;
 }
 /// <summary>Initializes a new instance of the NServiceKit.Razor.Managers.FileSystemWatcherLiveReload class.</summary>
 ///
 /// <param name="views">The views.</param>
 public FileSystemWatcherLiveReload(RazorViewManager views)
 {
     this.views = views;
 }
Esempio n. 5
0
 static ILiveReload CreateLiveReload(RazorViewManager viewManager)
 {
     return new FileSystemWatcherLiveReload(viewManager);
 }
Esempio n. 6
0
        /// <summary>Initialises this object.</summary>
        ///
        /// <returns>A RazorFormat.</returns>
        public virtual RazorFormat Init()
        {
            if (Instance != null)
            {
                Log.Warn("RazorFormat plugin should only be initialized once");

                if (ViewManager != null && PageResolver != null)
                    return this;

                Log.Warn("Incomplete initialization, RazorFormat.Instance set but ViewManager/PageResolver is null");
            }

            Instance = this;

            this.ViewManager = CreateViewManager();
            this.PageResolver = CreatePageResolver();

            this.ViewManager.Init();

            if (EnableLiveReload.GetValueOrDefault())
            {
                this.LiveReload = LiveReloadFactory(this.ViewManager);
                this.LiveReload.StartWatching(this.ScanRootPath);
            }
            return this;
        }