Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Programming Reflection 2007 with .NET
Technical Note 2225
Last Reviewed 14-Feb-2008
Applies To
Reflection for IBM 2007
Summary

This technical note provides information to programmers working with Reflection 2007 in a .NET development environment.

Getting Started with Reflection 2007 in .NET

The following information describes how to control Reflection 2007 from your .NET application.

API Information

For information on the .NET API:

  • Open the api_docs_dotnet.chm help file installed with Reflection 2007. For example, with a default English installation, the file is located in the C:\Program Files\Attachmate\Reflection2007\Help\Reflection2007\en\api directory.
  • Download the API Programmer’s Guide, RIBM_2007_API_Programmers_Guide.doc. This 74-page Microsoft Word document provides a number of code samples, describes the API objects and namespaces, and demonstrates handling events.

Add References to Reflection Assemblies

In the Microsoft Visual Studio 2005 development environment, add a reference to Reflection 2007 in your project as follows:

  1. On the Project menu, click Add Reference.
  2. In the Add References dialog box, on the .NET tab, select the three Attachmate.Reflection.* assemblies (Shift+click).
  3. Click OK.

Sample .NET C# Code

In addition to samples in the API Programmer’s Guide, you can download a code sample that demonstrates using Reflection 2007 in a .NET C# project:

  1. Download R2007-CSharp.zip from the Download Library.
  2. Unzip the downloaded file.
  3. Examine the .cs files in a text editor, or open the .sln file in Microsoft Visual Studio 2005.

This project presents a form dialog with buttons to demonstrate simple functionality. In Form1.cs, the functions buttonApplication_Click(), buttonSesion_Click(), and buttonVisible_Click() perform the following actions:

  • Start an instance of Reflection 2007 Workspace
  • Create an Application object (.NET Remoting connection to the Workspace)
  • Connect to a host by either:
    • Creating a new IBM 3270 terminal session in the Workspace (Note: The m_terminal.HostAddress line must be modified to use a host name or IP address in your environment.)
    • Opening a previously-saved .rd3x settings file in the Workspace
  • Wait for 1 second of quiet screen activity
  • Get the current terminal screen text
  • Fire an event to get the terminal screen text after one second of quiet
  • Create a view for the terminal session to make it visible in the Workspace

Other Information

If you are interested in embedding Reflection 2007, or adding Reflection 2007 controls to forms in your VB.NET or C# project, please contact Technical Support (http://support.attachmate.com/contact/).

Related Technical Notes
2183 Developer Tools for Attachmate Products
2211 Reflection for IBM 2007 Technical Notes

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.