示例#1
0
 /// <summary>
 /// Enables FlashMessages for the Nancy application, using the provided
 /// configuration
 /// </summary>
 /// <param name="pipelines"></param>
 /// <param name="configuration"></param>
 public static void Enable(IPipelines pipelines, FlashMessagesConfiguration configuration)
 {
     pipelines.BeforeRequest.AddItemToEndOfPipeline(ctx =>
     {
         ctx.SetFlashMessages(new FlashMessages(ctx.Request.Session, configuration));
         return(null);
     });
 }
 /// <summary>
 /// Enables FlashMessages for the Nancy application, using the provided 
 /// configuration
 /// </summary>
 /// <param name="pipelines"></param>
 /// <param name="configuration"></param>
 public static void Enable(IPipelines pipelines, FlashMessagesConfiguration configuration)
 {
     pipelines.BeforeRequest.AddItemToEndOfPipeline(ctx =>
     {
         ctx.SetFlashMessages(new FlashMessages(ctx.Request.Session, configuration));
         return null;
     });
 }
示例#3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="session"></param>
        /// <param name="configuration"></param>
        public FlashMessages(ISession session, FlashMessagesConfiguration configuration)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session", "You need to initialise a session provider in your Nancy Bootstrapper in order to use FlashMessages");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _session       = session;
            _configuration = configuration;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="session"></param>
        /// <param name="configuration"></param>
        public FlashMessages(ISession session, FlashMessagesConfiguration configuration)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session", "You need to initialise a session provider in your Nancy Bootstrapper in order to use FlashMessages");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _session = session;
            _configuration = configuration;
        }
示例#5
0
 public DefaultFlashMessageRenderer(FlashMessagesConfiguration configuration)
 {
     _configuration = configuration;
 }
 public DefaultFlashMessageRenderer(FlashMessagesConfiguration configuration)
 {
     _configuration = configuration;
 }