, Visual C#



­ - 9


( ) Properties axAgent2 Events Command.

Form1.h ( axAgent1_Command), ( ) .

47.16. , .

private void axAgent2_Command(object sender,

AxAgentObjects._AgentEvents_CommandEvent e)

{

// myCommand :

myCommand =

(AgentObjects.IAgentCtlUserInput)(e.userInput);

// "MoveToMouse"

// :

if (myCommand.Voice == "MoveToMouse")

{

myMerlin.MoveTo(

Convert.ToInt16(Cursor.Position.X),

Convert.ToInt16(Cursor.Position.Y), 1000);

}

// "Peedy"

// , :

if (myCommand.Voice == "Peedy")

{

// :

myMerlin.Hide(0);

// Form1

// "x,y" :

myPeedy.MoveTo(

Convert.ToInt16(this.Location.X + 400),

Convert.ToInt16(this.Location.Y - 130), 1000);

// :

myPeedy.Show(0);

// ,

// :

myAgentController = new AgentObjects.Agent();

myAgentController.Connected = true;

myAgentController.Characters.Load(

"peedy", "peedy.acs");

myPeedy =

myAgentController.Characters.Character("peedy");

// :

mySpeech = " - . ?";