Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > c1d139af9e515d72b460cf00f0f55d55 > files > 2

nant-0.86-0.beta1.2mdv2009.0.src.rpm

--- ExternalProgramBase.cs	2007/12/15 21:10:34	1.75
+++ ExternalProgramBase.cs	2007/12/18 20:15:19	1.76
@@ -66,6 +66,7 @@
         private int _exitCode = UnknownExitCode;
         private bool _spawn;
         private int _processId = 0;
+        private bool _useRuntimeEngine;
 
         #endregion Private Instance Fields
 
@@ -202,32 +203,63 @@
         /// <see langword="true" /> if the external program should be executed 
         /// using a runtime engine; otherwise, <see langword="false" />.
         /// </value>
+        /// <remarks>
+        ///   <para>
+        ///   The value of <see cref="UseRuntimeEngine" /> is only used from
+        ///   <see cref="Managed" />, and then only if its value is set to
+        ///   <see cref="ManagedExecution.Default" />. In which case
+        ///   <see cref="Managed" /> returns <see cref="ManagedExecution.Auto" />
+        ///   if <see cref="UseRuntimeEngine" /> is <see langword="true" />.
+        ///   </para>
+        ///   <para>
+        ///   In all other cases, the value of <see cref="UseRuntimeEngine" />
+        ///   is ignored.
+        ///   </para>
+        /// </remarks>
         [FrameworkConfigurable("useruntimeengine")]
         [Obsolete("Use the managed attribute and Managed property instead.", false)]
         public virtual bool UseRuntimeEngine {
-            get { return Managed != ManagedExecution.Default; }
-            set {
-                if (value) {
-                    Managed = ManagedExecution.Auto;
-                } else {
-                    Managed = ManagedExecution.Default;
-                }
-            }
+            get { return _useRuntimeEngine; }
+            set { _useRuntimeEngine = value; }
         }
 
         /// <summary>
-        /// Specifies whether the external program is a managed application
-        /// which should be executed using a runtime engine, if configured. 
-        /// The default is <see langword="false" />.
+        /// Specifies whether the external program should be treated as a managed
+        /// application, possibly forcing it to be executed under the currently
+        /// targeted version of the CLR.
         /// </summary>
         /// <value>
-        /// <see langword="true" /> if the external program should be executed 
-        /// using a runtime engine; otherwise, <see langword="false" />.
+        /// A <see cref="ManagedExecution" /> indicating how the program should
+        /// be treated.
         /// </value>
+        /// <remarks>
+        ///   <para>
+        ///   If <see cref="Managed" /> is set to <see cref="ManagedExecution.Default" />,
+        ///   which is the default value, and <see cref="UseRuntimeEngine" /> is
+        ///   <see langword="true" /> then <see cref="ManagedExecution.Auto" />
+        ///   is returned.
+        ///   </para>
+        ///   <para>
+        ///   When the changing <see cref="Managed" /> to <see cref="ManagedExecution.Default" />,
+        ///   then <see cref="UseRuntimeEngine" /> is set to <see langword="false" />;
+        ///   otherwise, it is changed to <see langword="true" />.
+        ///   </para>
+        /// </remarks>
         [FrameworkConfigurable("managed")]
         public virtual ManagedExecution Managed {
-            get { return _managed; }
-            set { _managed = value; }
+            get {
+                // deal with cases where UseRuntimeEngine is overridden to
+                // return true by default
+                if (UseRuntimeEngine && _managed == ManagedExecution.Default) {
+                    return ManagedExecution.Auto;
+                }
+
+                return _managed;
+            }
+            set {
+                _managed = value;
+                UseRuntimeEngine = (value != ManagedExecution.Default);
+            }
         }
 
         /// <summary>