/// <summary>
 ///     <para>
 ///       Adds the contents of another <see cref='.ApplicationCollection'/> to the end of the collection.
 ///    </para>
 /// </summary>
 /// <param name='value'>
 ///    A <see cref='.ApplicationCollection'/> containing the objects to add to the collection.
 /// </param>
 /// <returns>
 ///   <para>None.</para>
 /// </returns>
 /// <seealso cref='.ApplicationCollection.Add'/>
 public void AddRange(ApplicationCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Exemple #2
0
 /// <summary>
 /// Create applications
 ///
 /// Publish specific instance via remoting.
 /// http://www.dotnetremoting.cc/FAQs/PUBLISHING_OBJECT.asp
 /// </summary>
 public ApplicationServer(int AdminPort, string ApplicationBaseDir, LogStringEvent logstringevent) : base()
 {
     EnterMethod();
     try
     {
         AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler);
         if (logstringevent != null)
         {
             OnLog += logstringevent;
         }
         Applications = new ApplicationCollection();
         LogString("{0}: {1}",
                   GetType().Assembly.GetName().Name,
                   GetType().Assembly.GetName().Version.ToString());
         LogString("Publishing server objects on port {0}", AdminPort);
         AdminChannel = new TcpChannel(AdminPort);
         ChannelServices.RegisterChannel(AdminChannel);
         _ServerEnvironment = new ServerEnvironment();
         string path = @"users" + Path.DirectorySeparatorChar.ToString();
         byte[] Key  = new byte[8] {
             5, 100, 5, 2, 4, 24, 34, 55
         };
         byte[] IV = new byte[8] {
             5, 100, 5, 2, 4, 24, 34, 55
         };
         SecurityManager = new SecurityManager(new EncryptedFileStorage(path, Key, IV));
         RemotingServices.Marshal(this, "Mono.AppServer.ApplicationServer");
         AvailableApplicationTypes = (ApplicationType[])ConfigurationSettings.GetConfig("Mono.AppServer");
         DirectoryInfo curdir = new DirectoryInfo(ApplicationBaseDir);
         this.ApplicationsBaseDir = curdir.FullName + Path.DirectorySeparatorChar;
         LogString("\nHosting applications in {0}", Path.GetFullPath(ApplicationBaseDir));
         foreach (DirectoryInfo dir in curdir.GetDirectories())
         {
             try
             {
                 LoadApplication(dir);
             }
             catch (Exception e)
             {
                 SendError(e);
                 LogString("ERROR: " + e.Message);
             }
         }
     }
     catch (Exception E)
     {
         SendError(E);
         throw;
     }
     finally
     {
         ExitMethod();
     }
 }
Exemple #3
0
 /// <summary>
 /// Create applications
 /// 
 /// Publish specific instance via remoting.
 /// http://www.dotnetremoting.cc/FAQs/PUBLISHING_OBJECT.asp
 /// </summary>
 public ApplicationServer(int AdminPort, string ApplicationBaseDir, LogStringEvent logstringevent):base()
 {
   EnterMethod();
   try
   {
     AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler);
     if (logstringevent != null)
     {
       OnLog += logstringevent;
     }
     Applications=new ApplicationCollection();
     LogString("{0}: {1}",
       GetType().Assembly.GetName().Name,
       GetType().Assembly.GetName().Version.ToString());
     LogString("Publishing server objects on port {0}",AdminPort);
     AdminChannel = new TcpChannel( AdminPort ); 
     ChannelServices.RegisterChannel( AdminChannel ); 
     _ServerEnvironment=new ServerEnvironment();
     string path=@"users"+Path.DirectorySeparatorChar.ToString ();
     byte[] Key=new byte[8] { 5,100,5,2,4,24,34,55 };
     byte[] IV=new byte[8] { 5,100,5,2,4,24,34,55};
     SecurityManager=new SecurityManager(new EncryptedFileStorage(path,Key,IV));
     RemotingServices.Marshal(this,"Mono.AppServer.ApplicationServer");
     AvailableApplicationTypes=(ApplicationType[]) ConfigurationSettings.GetConfig("Mono.AppServer");
     DirectoryInfo curdir=new DirectoryInfo(ApplicationBaseDir);
     this.ApplicationsBaseDir=curdir.FullName+Path.DirectorySeparatorChar;
     LogString("\nHosting applications in {0}",Path.GetFullPath(ApplicationBaseDir));
     foreach (DirectoryInfo dir in curdir.GetDirectories())
     {
       try
       {
         LoadApplication(dir);
       }
       catch (Exception e)
       {
         SendError(e);
         LogString("ERROR: " + e.Message);
       }
     }
   }
   catch(Exception E)
   {
     SendError(E);
     throw;
   }
   finally
   {
     ExitMethod();
   }
 }
		/// <summary>
		///     <para>
		///       Initializes a new instance of <see cref='.ApplicationCollection'/> based on another <see cref='.ApplicationCollection'/>.
		///    </para>
		/// </summary>
		/// <param name='value'>
		///       A <see cref='.ApplicationCollection'/> from which the contents are copied
		/// </param>
		public ApplicationCollection(ApplicationCollection value) {
			this.AddRange(value);
		}
			public ApplicationBaseEnumerator(ApplicationCollection mappings) {
				this.temp = ((IEnumerable)(mappings));
				this.baseEnumerator = temp.GetEnumerator();
			}
		/// <summary>
		///     <para>
		///       Adds the contents of another <see cref='.ApplicationCollection'/> to the end of the collection.
		///    </para>
		/// </summary>
		/// <param name='value'>
		///    A <see cref='.ApplicationCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		///   <para>None.</para>
		/// </returns>
		/// <seealso cref='.ApplicationCollection.Add'/>
		public void AddRange(ApplicationCollection value) {
			for (int i = 0; (i < value.Count); i = (i + 1)) {
				this.Add(value[i]);
			}
		}
 /// <summary>
 ///     <para>
 ///       Initializes a new instance of <see cref='.ApplicationCollection'/> based on another <see cref='.ApplicationCollection'/>.
 ///    </para>
 /// </summary>
 /// <param name='value'>
 ///       A <see cref='.ApplicationCollection'/> from which the contents are copied
 /// </param>
 public ApplicationCollection(ApplicationCollection value)
 {
     this.AddRange(value);
 }
 public ApplicationBaseEnumerator(ApplicationCollection mappings)
 {
     this.temp           = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }