示例#1
0
        private void OnClicked(object o, EventArgs eventArgs)
        {
            var currentIndex = mScenes.IndexOf(mActiveScene);
            var index        = currentIndex + 1;

            if (index > mScenes.Count - 1)
            {
                index = 0;
            }
            mActiveScene = mScenes[index];
            mActiveScene.Apply();
        }
示例#2
0
 public LightSceneSwitcher(IReadOnlyList <LightScene> scenes, ISwitch @switch)
 {
     mScenes          = scenes.ToList();
     mActiveScene     = mScenes[0];
     @switch.Clicked += OnClicked;
 }