private void LoadWidget(WidgetType type) { if (Application.OpenForms["Options"] == null) { activeWidget = true; SetTrayIcon(type); switch (type) { case WidgetType.EyeDropper: globalCursor.Change(@"%systemroot%\Cursors\cross_i.cur"); var eyedropper = new EyeDropper(); eyedropper.Show(); ((IAbrovinkWidget)eyedropper).isClosing += CleanUpWidget; break; case WidgetType.Ruler: globalCursor.Change(@"%systemroot%\Cursors\cross_i.cur"); var ruler = new Ruler(); ruler.isClosing += CleanUpWidget; break; default: break; } } }
void OnEyeDropperMove(TimerState state) { Color pickerColor = EyeDropper.GetPickedColor(); if (pickerColor != GetValue()) { SetValue(pickerColor.linear); } }
void OnEyeDropperStart(MouseDownEvent e) { if (EyeDropper.IsOpened) { return; } this.m_InitialColor = m_Value; EyeDropper.Start(OnGammaColorChanged); m_EyeDropperScheduler = this.schedule.Execute(OnEyeDropperMove).Every(10).StartingIn(10).Until(this.ShouldStopWatchingEyeDropper); }
void OnEyeDropperStart(MouseDownEvent e) { EyeDropper.Start(OnGammaColorChanged); m_EyeDropperScheduler = this.schedule.Execute(OnEyeDropperMove).Every(10).StartingIn(10); m_EyeDropper.UnregisterCallback <MouseDownEvent>(OnEyeDropperStart); }