Пример #1
0
 public static Uri uri(this MS_VS_WebServer webServer, string virtualPath)
 {
     if (virtualPath.valid() && (virtualPath.starts("/") || virtualPath.starts("\\")))
     {
         virtualPath = virtualPath.removeFirstChar();
     }
     return((webServer.DefaultUrl + virtualPath).uri());
 }
Пример #2
0
        public static MS_VS_WebServer startWebServer(this string localPath, int port, string virtualPath)
        {
            var serverCacheKey = MS_VS_WebServer.serverCacheKey(localPath, port.str(), virtualPath);

            if (MS_VS_WebServer.serverCache.hasKey(serverCacheKey))
            {
                "found MS_VS_WebServer object in cache".info();
                var msWebServer = MS_VS_WebServer.serverCache[serverCacheKey];
                if (msWebServer.WebServerProcess.notNull() && msWebServer.WebServerProcess.HasExited.isFalse())
                {
                    return(MS_VS_WebServer.serverCache[serverCacheKey]);
                }
            }
            "creating new instance of Cassini 4.0".info();
            var webServer = new MS_VS_WebServer(localPath, port, virtualPath);

            //if (webServer.WebServerProcess.isNull());
            //	return null;
            MS_VS_WebServer.serverCache.add(serverCacheKey, webServer);
            return(webServer);
        }
		public static MS_VS_WebServer startWebServer(this string localPath, int port, string virtualPath)
		{						
			var serverCacheKey = MS_VS_WebServer.serverCacheKey(localPath, port.str(), virtualPath);
			if (MS_VS_WebServer.serverCache.hasKey(serverCacheKey))
			{
				"found MS_VS_WebServer object in cache".info();
				var msWebServer = MS_VS_WebServer.serverCache[serverCacheKey];
				if (msWebServer.WebServerProcess.notNull() && msWebServer.WebServerProcess.HasExited.isFalse())
					return MS_VS_WebServer.serverCache[serverCacheKey];
			}
			"creating new instance of Cassini 4.0".info();
			var webServer = new MS_VS_WebServer(localPath, port, virtualPath);			
			//if (webServer.WebServerProcess.isNull());	
			//	return null;			
			MS_VS_WebServer.serverCache.add(serverCacheKey, webServer);
			return webServer;
		}			
Пример #4
0
 public static string html(this MS_VS_WebServer webServer, string virtualPath)
 {
     return(webServer.uri(virtualPath).getHtml());
 }