/// <summary> /// Adds the current value to the selected list without modifying the /// existing selection /// </summary> /// <param name="value"></param> void OnCtrlClickEvent(LightView value) { mColorModeSelected = true; value.Selected = true; }
void OnSineEvent(LightView value) { List<int> indices = new List<int>(); foreach(LightView lv in SelectedLights) { indices.Add(mLightViews.IndexOf(lv)); } EventUtils.FireTypedEvent(SineEventFired, indices); }
void HandlePasteEvent(LightView pLight) { foreach (LightView light in SelectedLights) { light.Color = mCopiedColor; } }
void HandleStopEventClicked(LightView value) { List<int> indices = new List<int>(); foreach (LightView lv in SelectedLights) { indices.Add(mLightViews.IndexOf(lv)); } EventUtils.FireTypedEvent(StopEventFired, indices); }
/// <summary> /// Clears previous light selections. /// pLight will be set to selected. /// </summary> /// <param name="pLight"></param> protected void SelectLight(LightView pSelectedLight) { foreach (LightView lv in mLightViews) { if (lv != pSelectedLight) { lv.Selected = false; } } pSelectedLight.Selected = true; }
/// <summary> /// Clear the previous light selections. /// The light that has been clicked on is now selected. /// </summary> /// <param name="pSelectedLight"></param> protected virtual void OnDirectLightClick(LightView pSelectedLight) { SelectLight(pSelectedLight); mColorModeSelected = true; mHoverIndex = mLightViews.IndexOf(pSelectedLight); }
protected void InitializeSelectedLight(LightView pSelectedLight) { mHoverIndex = mLightViews.IndexOf(pSelectedLight); Color curColor = ColorUtils.GetRandomColor(); pSelectedLight.Color = curColor; EventUtils.FireDualTypedEvent(LightUpdate, mHoverIndex, curColor); }
/// <summary> /// Clear previous light selections. /// The light that has been clicked on is now selected. /// Change the light to a random color. /// </summary> /// <param name="value"></param> protected virtual void HandleDoubleClickOnLight(LightView pSelectedLight) { SelectLight(pSelectedLight); mColorModeSelected = true; InitializeSelectedLight(pSelectedLight); }
protected void AddLight(LightView pView) { pView.DirectClickEvent += new TypedDelegate<LightView>(OnDirectLightClick); pView.SaveFired += new TypedDelegate<gigaFlash.ConfigObjects.ColorConfig>(HandleColorSaveFired); pView.ColorSet += new TypedDelegate<ILightView>(OnColorSet); pView.CopyEventFired += new TypedDelegate<Color>(HandleCopyEvent); pView.PasteEventFired += new TypedDelegate<LightView>(HandlePasteEvent); pView.DoubleClickEvent += new TypedDelegate<LightView>(HandleDoubleClickOnLight); pView.CtrlClickEvent += new TypedDelegate<LightView>(OnCtrlClickEvent); pView.SineEventFired += new TypedDelegate<LightView>(OnSineEvent); pView.StopEventFired += new TypedDelegate<LightView>(HandleStopEventClicked); mLightViews.Add(pView); EventUtils.FireTypedEvent(LightViewAdded, pView); }