示例#1
0
 public void AddState(int itemindex, int keyindex, bool iskey)
 {
     try
     {
         var be   = canvasDock.EffectManager.Effects[itemindex] as BaseEffect;
         var name = Path.GetFileNameWithoutExtension(be.Filename);
         var asc  = new AddStateCommand(canvasDock.EffectManager, (iskey ? key : "") + insertstate + name, iskey, itemindex, keyindex);
         asc.Execute();
         historyDock.CommandManager.AddCommand(asc);
         RefreshState();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
示例#2
0
        /// <summary>
        /// Adds a new State with the given position to the graph
        /// </summary>
        /// <param name="graph"></param>
        /// <param name="position">The position of the state</param>
        /// <returns></returns>
        public static void AddState(this StateMachine stateMachine, Vector2 position)
        {
            ICommand command = new AddStateCommand(stateMachine, position);

            command.Execute();
        }