示例#1
0
 public void ValidateParameterValues(ParameterValueCollection parameters)
 {
     if (_prop == null)
     {
         FormWarning.ShowMessage("Error calling {0}.ValidateParameterValues. Property not set. Action:{1}", this.GetType().FullName, this.Action);
     }
     else
     {
         ParameterValue p = null;
         foreach (ParameterValue pv in parameters)
         {
             if (string.Compare(pv.Name, PropertyValueName, StringComparison.Ordinal) == 0)
             {
                 p = pv;
                 break;
             }
         }
         if (p == null)
         {
             p = createValue();
         }
         if (_prop.PropertyType != null)
         {
             p.SetDataType(_prop.PropertyType);
         }
         IList <Attribute> ed = _prop.GetUITypeEditor();
         if (ed != null && ed.Count > 0)
         {
             Attribute[] atts = new Attribute[ed.Count];
             ed.CopyTo(atts, 0);
             p.MergeValueAttributes(atts);
         }
         parameters.Clear();
         parameters.Add(p);
     }
 }