Пример #1
0
 public override void OnSetAttribute()
 {
     attribute = Attribute <SliderInputAttribute>();
     if (attribute.IsAutoRange)
     {
         setValue(attribute.Default, attribute.Range, attribute.IsInt);
     }
     else
     {
         setValue(attribute.Default, attribute.Min, attribute.Max, attribute.IsInt);
     }
 }
Пример #2
0
 public override void OnSetAttribute()
 {
     attribute  = Attribute <SliderInputAttribute>();
     bInt       = attribute.IsInt;
     ScaleRange = bInt ? 1.0f : 100.0f;
     if (attribute.IsAutoRange)
     {
         Range = (int)(attribute.Range * ScaleRange);
     }
     else
     {
         Range = (int)((attribute.Max - attribute.Min) * ScaleRange);
     }
     trackBar1.Minimum = (int)(attribute.Min * ScaleRange);
     trackBar1.Maximum = (int)(attribute.Max * ScaleRange);
     setValue(attribute.Default * ScaleRange);
 }