Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Remoting
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29413
Modified Files:
RemotingConfigurer.cs
Log Message:
Make current AppDomain's config file the default for RemotingConfigurer if filename==null [SPRNET-730]
Index: RemotingConfigurer.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/Remoting/RemotingConfigurer.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** RemotingConfigurer.cs 11 Sep 2007 20:56:27 -0000 1.6
--- RemotingConfigurer.cs 8 Oct 2007 14:57:34 -0000 1.7
***************
*** 47,50 ****
--- 47,51 ----
private IResource _filename;
+ private bool _useConfigFile = true;
private bool _ensureSecurity = false;
***************
*** 64,72 ****
/// <summary>
! /// Gets or sets the name of the remoting configurationn file.
/// </summary>
/// <remarks>
/// If filename is <see langword="null"/> or not set,
! /// default remoting configuration will be used.
/// </remarks>
public IResource Filename
--- 65,73 ----
/// <summary>
! /// Gets or sets the name of the remoting configuration file.
/// </summary>
/// <remarks>
/// If filename is <see langword="null"/> or not set,
! /// current AppDomain's configuration file will be used.
/// </remarks>
public IResource Filename
***************
*** 77,80 ****
--- 78,94 ----
/// <summary>
+ /// Indicates whether a configuration file is used.
+ /// Default value is <see langword="true"/>.
+ /// </summary>
+ /// <remarks>
+ /// If <see langword="false"/>, default remoting configuration will be used.
+ /// </remarks>
+ public bool UseConfigFile
+ {
+ get { return _useConfigFile; }
+ set { _useConfigFile = value; }
+ }
+
+ /// <summary>
/// Gets or sets if security is enabled.
/// </summary>
***************
*** 110,114 ****
public void PostProcessObjectFactory(IConfigurableListableObjectFactory factory)
{
! string filename = (Filename == null) ? null : Filename.File.FullName;
#if NET_2_0
RemotingConfiguration.Configure(filename, EnsureSecurity);
--- 124,134 ----
public void PostProcessObjectFactory(IConfigurableListableObjectFactory factory)
{
! string filename = null;
! if (UseConfigFile)
! {
! filename = (Filename == null)
! ? AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
! : Filename.File.FullName;
! }
#if NET_2_0
RemotingConfiguration.Configure(filename, EnsureSecurity);
|