InfoConnect API Guide
Attachmate.Reflection.UserControl.Wpf.OpenSystems Namespace / OpenSystemsTerminalControl 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 OpenSystemsTerminalControl
    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 errors that may have occurred during terminal initialization.

    Example
    Open a session document file to initialize a terminal user control and then check for errors
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        openSystemsTerminalControl1.InitInstance(System.Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\demo.rdox");
    }
     
    private void OpenSystemsTerminalControl1_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