示例#1
0
 void reloadApp()
 {
     Console.Error.WriteLine("Nginx Mono Host is Loading the Application");
     lock (AppLoadingLock)
     {
         if (watchers != null)
         {
             foreach (var watcher in watchers)
             {
                 watcher.EnableRaisingEvents = false;
                 watcher.Dispose();
             }
         }
         if (AppInstance != null)
         {
             try
             {
                 Console.Error.WriteLine("Nginx Mono Host is Unloading existing HostManager");
                 AppInstance.Unload();
             }
             finally {
                 AppInstance = null;
             }
         }
         try
         {
             string appDir = appFolder;
             Console.Error.WriteLine("Nginx Mono Host running at '{0}' is Loading new HostManager for directory '{1}'", Environment.CurrentDirectory, appDir);
             AppInstance = NginxBlackHostManager.LoadApplication <NginxBlackHostManager>(appDir);
         }finally
         {
             initWatchers();
         }
     }
 }
示例#2
0
	void reloadApp ()
	{
		Console.Error.WriteLine ("Nginx Mono Host is Loading the Application");
		lock (AppLoadingLock)
		{
			if (watchers != null)
			{
				foreach (var watcher in watchers)
				{
					watcher.EnableRaisingEvents = false;
					watcher.Dispose ();
				}
			}
			if (AppInstance != null)
			{
				try
				{
					Console.Error.WriteLine ("Nginx Mono Host is Unloading existing HostManager");
					AppInstance.Unload ();
				}
				finally {
					AppInstance = null;
				}
			}
			try
			{
				string appDir = appFolder;
				Console.Error.WriteLine ("Nginx Mono Host running at '{0}' is Loading new HostManager for directory '{1}'",Environment.CurrentDirectory,appDir);
				AppInstance = NginxBlackHostManager.LoadApplication<NginxBlackHostManager>(appDir);
			}finally
			{
				initWatchers();
			}
			
		}
	}