InfoConnect API Guide
Attachmate.Reflection.UserControl.Wpf.IbmHosts Namespace / IbmTerminalControl Class / InitInstance Method / InitInstance(String) Method
The session path.
Example


In This Topic
    InitInstance(String) Method
    In This Topic
    Initializes this terminal instance with an existing session file.
    Syntax
    'Declaration
     
    
    Public Overloads Sub InitInstance( _
       ByVal sessionFilePath As String _
    ) 
    'Usage
     
    
    Dim instance As IbmTerminalControl
    Dim sessionFilePath As String
     
    instance.InitInstance(sessionFilePath)
    public void InitInstance( 
       string sessionFilePath
    )

    Parameters

    sessionFilePath
    The session path.
    Remarks

    The InitInstance call is required to initialize the terminal user control with sufficient information to render a terminal user interface.

    Use the TerminalInitializedEventHandler to check for any errors that may have occurred during terminal initialization

    Example
    Open a session document file to initialize a terminal user control and check for initialization errors
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        ibmTerminalControl1.InitInstance(System.Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\demo.rd3x");
    }
     
    private void IbmTerminalControl1_TerminalInitializedEvent(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
    {
        // Check if error occurred during the terminal initialization
        if (e.Error != null)
        {
            MessageBox.Show("Error during terminal initialization step: " + e.Error); return;
        }
     
    }
    See Also