示例#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;
 }
示例#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);
 }
示例#3
0
 void HandlePasteEvent(LightView pLight)
 {
     foreach (LightView light in SelectedLights)
     {
         light.Color = mCopiedColor;
     }
 }
示例#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);
 }
示例#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;
 }
示例#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);
 }
示例#7
0
 protected void InitializeSelectedLight(LightView pSelectedLight)
 {
     mHoverIndex = mLightViews.IndexOf(pSelectedLight);
     Color curColor = ColorUtils.GetRandomColor();
     pSelectedLight.Color = curColor;
     EventUtils.FireDualTypedEvent(LightUpdate,
         mHoverIndex,
         curColor);
 }
示例#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);
 }
示例#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);
        }