Example #1
0
        //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);
            }
        }
Example #2
0
 public void Execute()
 {
     composite.SetID(replacement, id);
 }