Exemple #1
0
 /// <summary>
 /// Stops the CassiniServer (by calling its ShutDown method)
 /// </summary>
 /// <param name="apiCassini"></param>
 /// <returns></returns>
 public static API_Cassini   stop(this API_Cassini apiCassini)
 {
     if (apiCassini.notNull())
     {
         apiCassini.CassiniServer.ShutDown();
     }
     return(apiCassini);
 }
Exemple #2
0
 /// <summary>
 /// Starts the CassiniServer (cy calling its Start Method)
 /// </summary>
 /// <param name="apiCassini"></param>
 /// <returns></returns>
 public static API_Cassini   start(this API_Cassini apiCassini)
 {
     if (apiCassini.notNull())
     {
         apiCassini.CassiniServer.Start();
     }
     return(apiCassini);
 }
Exemple #3
0
 /// <summary>
 /// Returns the root URL of the current server
 /// </summary>
 /// <param name="apiCassini"></param>
 /// <returns></returns>
 public static string        url(this API_Cassini apiCassini)
 {
     if (apiCassini.notNull())
     {
         var server = apiCassini.server();
         return("http://{0}:{1}/".format(server.IPAddress.str(), server.Port));
     }
     return(null);
 }
Exemple #4
0
 /// <summary>
 /// Returns a  reference to the CassiniServer object
 /// </summary>
 /// <param name="apiCassini"></param>
 /// <returns></returns>
 public static Server        server(this API_Cassini apiCassini)
 {
     return((apiCassini.notNull())
         ? apiCassini.CassiniServer
         : null);
 }
Exemple #5
0
 /// <summary>
 /// Returns the port of the current cassini server
 /// </summary>
 /// <param name="apiCassini"></param>
 /// <returns></returns>
 public static int           port(this API_Cassini apiCassini)
 {
     return(apiCassini.notNull()
                 ? apiCassini.CassiniServer.Port
                 : -1);
 }
 public static string webRoot(this API_Cassini apiCassini)
 {
     return((apiCassini.notNull()) ? apiCassini.PhysicalPath : null);
 }