Esempio n. 1
0
 private void cbSoftLimitEnable_CheckedChanged(object sender, EventArgs e)
 {
     if (isInitFinished)
     {
         PropertyInfo[] pi = axis.AxisPara.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public);
         foreach (PropertyInfo p in pi)
         {
             if (((CheckBox)sender).Tag.ToString() == p.Name)
             {
                 bool b = Convert.ToBoolean(((CheckBox)sender).Checked);
                 if (p.PropertyType.BaseType.Name == "ValueType")
                 {
                     p.SetValue(axis.AxisPara, Convert.ChangeType(b, p.PropertyType), null);
                 }
                 axis.SetSoftLimit(b, axis.AxisPara.SoftLimitN, axis.AxisPara.SoftLimitP);
             }
         }
     }
 }