After the user clicks the Call Button, what does the following event handler do?
private void btnCall_Click(
object sender, System.EventArgs e )
{
objMainAgent.Characters.Load( "Genie","Genie.acs" );
objMSpeaker = objMainAgent.Characters[ "Genie" ];
objMSpeaker.Show( 0 );
objMSpeaker.Speak( "Hello, I'm Genie the special agent!", "" );
} // end method btnCall_Click
The agent object is loaded as “Genie.” Genie appears and says, "Hello, I'm Genie
the special agent!" The complete code reads:
// Genie.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;.
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace Genie
{
///
/// Summary description for FrmGenie.
///
public class FrmGenie : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lblCall;
private System.Windows.Forms.Button btnCall;
private AxAgentObjects.AxAgent objMainAgent;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public FrmGenie()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent
// call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private AgentObjects.IAgentCtlCharacter objMSpeaker;
// Windows Form Designer generated code
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run( new FrmGenie() );
}
// calls "Genie" the agent
private void btnCall_Click(
object sender, System.EventArgs e )
{
objMainAgent.Characters.Load( "Genie","Genie.acs" );
objMSpeaker = objMainAgent.Characters[ "Genie" ];
objMSpeaker.Show( 0 );
objMSpeaker.Speak( "Hello, I'm Genie the special agent!",
"" );
} // end method btnCall_Click
} // end class FrmGenie
}

You might also like to view...
Which of the following is NOT a way to unhide column A in a worksheet?
A) Type A1 in the name box and then press the Enter key B) Right-click the hidden column heading and select Unhide C) Click Unhide on the View tab D) Click Select All and use the Hide & Unhide submenu
What is the best indication that a laptop battery needs to be replaced?
A) The laptop has to be constantly restarted. B) The laptop operates only from AC power. C) The laptop constantly reboots on its own. D) The laptop operates only from DC power.
The Hong Kong and Kuala Lumpur airports suffered from computer system failures on their opening days What was to blame for these failures
What name is given to the port numbers in the range of 0 to 1023?
A. Private port numbers B. Dynamic port numbers C. Well-known port numbers D. Listening ports