public void SetParam(Controllable.Parameter p) { if (p == null) { param = null; txt.Content = "Empty"; bg.Fill = Brushes.Gray; } param = p; txt.Content = param.name; Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.SystemIdle, new work(SetColor)); }
public Controllable.Parameter SearchParam(string name) { foreach (Controllable c in devs) { Controllable.Parameter p = c.GetParameter(name); if (p != null) { return(p); } } return(null); }
public void SetColor() { try { SolidColorBrush b; if (param.getr() <= 127.5) { b = new SolidColorBrush(Color.FromRgb((byte)(param.getr() * 2), 255, 0)); } else { b = new SolidColorBrush(Color.FromRgb(255, (byte)(255 - param.getr() * 2), 0)); } bg.Fill = b; } catch { param = null; txt.Content = "Empty"; bg.Fill = Brushes.Gray; } Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.SystemIdle, new work(SetColor)); }
public output(ref Controllable.Parameter s) { this.s = s; }