Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 void OnSineEvent(LightView value)
 {
     List<int> indices = new List<int>();
     foreach(LightView lv in SelectedLights)
     {
         indices.Add(mLightViews.IndexOf(lv));
     }
     EventUtils.FireTypedEvent(SineEventFired, indices);
 }
Ejemplo n.º 3
0
 void HandlePasteEvent(LightView pLight)
 {
     foreach (LightView light in SelectedLights)
     {
         light.Color = mCopiedColor;
     }
 }
Ejemplo n.º 4
0
 void HandleStopEventClicked(LightView value)
 {
     List<int> indices = new List<int>();
     foreach (LightView lv in SelectedLights)
     {
         indices.Add(mLightViews.IndexOf(lv));
     }
     EventUtils.FireTypedEvent(StopEventFired, indices);
 }
Ejemplo n.º 5
0
 /// <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;
 }
Ejemplo n.º 6
0
 /// <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);
 }
Ejemplo n.º 7
0
 protected void InitializeSelectedLight(LightView pSelectedLight)
 {
     mHoverIndex = mLightViews.IndexOf(pSelectedLight);
     Color curColor = ColorUtils.GetRandomColor();
     pSelectedLight.Color = curColor;
     EventUtils.FireDualTypedEvent(LightUpdate,
         mHoverIndex,
         curColor);
 }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
        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);
        }