예제 #1
0
파일: MainPage.xaml.cs 프로젝트: Yup746/DP
        //This places the last added ornament of all selected composites at the position of the arrow key pressed
        private void KeyPressed(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key.ToString() == "Up" || e.Key.ToString() == "Down" || e.Key.ToString() == "Left" || e.Key.ToString() == "Right")
            {
                string newposition = "Placeholder";
                switch (e.Key.ToString())
                {
                case "Up":
                    newposition = "top";
                    break;

                case "Down":
                    newposition = "bottom";
                    break;

                case "Left":
                    newposition = "left";
                    break;

                case "Right":
                    newposition = "right";
                    break;
                }
                foreach (int c in selected)
                {
                    Composite newcomposite = group.FindID(c);
                    if (newcomposite.ornaments.Count > 0)
                    {
                        newcomposite.ornaments[newcomposite.ornaments.Count - 1].position = newposition;
                        group.SetID(newcomposite, c);
                    }
                }
                Update(true);
                Update(false);
            }
        }
예제 #2
0
파일: CommandClasses.cs 프로젝트: Yup746/DP
 public void Execute()
 {
     composite.SetID(replacement, id);
 }