Example #1
0
 /// <summary> Sets the given property to the given vector value, if both are allowed by any existing ruleset</summary>
 /// <param name="propertyName">The property to be set
 /// </param>
 /// <param name="propertyValue">The value that the property will be set to
 /// </param>
 public virtual void setProperty(System.String propertyName, System.Collections.ArrayList propertyValue)
 {
     System.Collections.ArrayList oldValue = getProperty(propertyName);
     if (oldValue != null && vectorEquals(oldValue, propertyValue))
     {
         //No point in redundantly setting values!
         return;
     }
     if (rulesList.Count == 0)
     {
         writeValue(propertyName, propertyValue);
     }
     else
     {
         bool valid = true;
         System.Collections.IEnumerator en = propertyValue.GetEnumerator();
         //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
         while (en.MoveNext())
         {
             // RL - checkPropertyAllowed is implicit in checkValueAllowed
             //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
             if (!checkValueAllowed(propertyName, (System.String)en.Current))
             {
                 valid = false;
             }
         }
         if (valid)
         {
             writeValue(propertyName, propertyValue);
             notifyChanges(propertyName);
         }
         //#if debug.output==verbose
         else
         {
             System.Console.Out.WriteLine("Property Manager: Unable to write value (" + propertyValue.ToString() + ") to " + propertyName);
         }
         //#endif
     }
 }