Example #1
0
        /// <summary>
        /// This is the string that is obtained after the request is handled/complete, it gets sent back to the client.
        /// </summary>
        /// <param name="nt">Type of the NancyRequest received. This is used commonly to jump between query types.</param>
        public override string Handle(NancyRequestType nt)
        {
            string type = Request.Query["languageType"] ?? "";

            switch (type)
            {
            case "en":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.EN));

            case "de":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.DE));

            case "es":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.ES));

            case "fr":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.FR));

            case "it":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.IT));

            case "ru":
                return(Manager.Resources.StaticFiles.Obtain(StaticFile.RU));

            default:
                return("<Error>Invalid langauge type.</Error>");
            }
        }
Example #2
0
 /// <summary>
 /// This is a query expansion to the normal request handling.
 /// </summary>
 /// <param name="nt">Type of the NancyRequest received. This is used commonly to jump between query types.</param>
 public string qHandle(NancyRequestType nt)
 {
     foreach (var i in Request.Body.AsString().Split('&'))
     {
         var d = i.Split('=');
         if (d.Length >= 0)
         {
             Request.Query[d[0]] = d[1];
         }
     }
     return(Handle(nt));
 }
Example #3
0
 /// <summary>
 /// This is the string that is obtained after the request is handled/complete, it gets sent back to the client.
 /// </summary>
 /// <param name="nt">Type of the NancyRequest received. This is used commonly to jump between query types.</param>
 public override string Handle(NancyRequestType nt)
 => Manager.Resources.StaticFiles.Obtain(StaticFile.CROSSDOMAIN);
Example #4
0
 /// <summary>
 /// This is the string that is obtained after the request is handled/complete, it gets sent back to the client.
 /// </summary>
 /// <param name="nt">Type of the NancyRequest received. This is used commonly to jump between query types.</param>
 public override string Handle(NancyRequestType nt)
 => "";
Example #5
0
 /// <summary>
 /// This is the string that is obtained after the request is handled/complete, it gets sent back to the client.
 /// </summary>
 /// <param name="nt">Type of the NancyRequest received. This is used commonly to jump between query types.</param>
 abstract public string Handle(NancyRequestType nt);