Пример #1
0
 /// <summary>
 /// Set a given constant's value.
 /// </summary>
 /// <param name="constantName">Name of the constant.</param>
 /// <param name="constantValue">The constant value.</param>
 public void SetConstant(string constantName, string constantValue)
 {
     foreach (ApsimConstant c in _Constants)
     {
         if (StringUtilities.StringsAreEqual(c.Name, constantName))
         {
             c.Value = constantValue;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Constants the specified constant name.
 /// </summary>
 /// <param name="constantName">Name of the constant.</param>
 /// <returns>Return a given constant to caller</returns>
 public ApsimConstant Constant(string constantName)
 {
     foreach (ApsimConstant c in _Constants)
     {
         if (StringUtilities.StringsAreEqual(c.Name, constantName))
         {
             return(c);
         }
     }
     return(null);
 }