private void SetCurrentStateImage(eSettingItem_State state) { CycleCollection <int> activeStateImgColl; if (_stateImageMaping.TryGetValue(state, out activeStateImgColl)) { IEnumerator <int> cycleIterator = activeStateImgColl.GetEnumerator(); if (cycleIterator.MoveNext()) { int index = cycleIterator.Current; if (index >= _imgList.Images.Count) { throw new Exception("img index out of range"); } this.pbLogo.Image = _imgList.Images[index]; } } }
private void SetCurrentStateImage(eSettingItem_State state) { CycleCollection<int> activeStateImgColl; if (_stateImageMaping.TryGetValue(state, out activeStateImgColl)) { IEnumerator<int> cycleIterator = activeStateImgColl.GetEnumerator(); if (cycleIterator.MoveNext()) { int index = cycleIterator.Current; if (index >= _imgList.Images.Count) throw new Exception("img index out of range"); this.pbLogo.Image = _imgList.Images[index]; } } }
public void RegisterStateImage(eSettingItem_State itemState, params int[] imgIndexes) { CycleCollection <int> imgIndexColl = CycleCollection <int> .CreateInstance(0, imgIndexes); _stateImageMaping[itemState] = imgIndexColl; }
public void RegisterStateImage(eSettingItem_State itemState, params int[] imgIndexes) { CycleCollection<int> imgIndexColl = CycleCollection<int>.CreateInstance(0, imgIndexes); _stateImageMaping[itemState] = imgIndexColl; }