コード例 #1
0
 private void MoveAlphabetBy(int steps)
 {
     if (steps > 0)
     {
         for (var i = 0; i < steps; i++)
         {
             var firstLetterInner = InnerLetterViews.First();
             var firstLetterOuter = OuterLetterViews.First();
             InnerLetterViews.Remove(firstLetterInner);
             OuterLetterViews.Remove(firstLetterOuter);
             InnerLetterViews.Add(firstLetterInner);
             OuterLetterViews.Add(firstLetterOuter);
         }
     }
     else
     {
         for (var i = 0; i > steps; i--)
         {
             var lastLetterInner = InnerLetterViews.Last();
             var lastLetterOuter = OuterLetterViews.Last();
             InnerLetterViews.Remove(lastLetterInner);
             OuterLetterViews.Remove(lastLetterOuter);
             InnerLetterViews.Insert(0, lastLetterInner);
             OuterLetterViews.Insert(0, lastLetterOuter);
         }
     }
 }
コード例 #2
0
 public override void Initialize()
 {
     base.Initialize();
     foreach (var letter in CommonHelper.GetShiftedAlphabet(PositionShift))
     {
         InnerLetterViews.Add(HelpersViewModelFactory.CreateLetter(letter));
         OuterLetterViews.Add(HelpersViewModelFactory.CreateLetter(letter));
     }
 }