Reflection .NET API
Attachmate.Reflection.Framework Assembly / Attachmate.Reflection.Framework Namespace / Application Class / Close Method
Specifies the Save action when closing a Reflection application.
Example


In This Topic
    Close Method (Application)
    In This Topic
    Closes the Reflection application.
    Syntax
    'Declaration
     
    
    Public Sub Close( _
       ByVal closeOption As ApplicationCloseOption _
    ) 
    'Usage
     
    
    Dim instance As Application
    Dim closeOption As ApplicationCloseOption
     
    instance.Close(closeOption)
    public void Close( 
       ApplicationCloseOption closeOption
    )

    Parameters

    closeOption
    Specifies the Save action when closing a Reflection application.
    Example
    This example shows how to close Reflection.
    using Attachmate.Reflection.Emulation.IbmHosts;
    using Attachmate.Reflection.Framework;
    using Attachmate.Reflection.UserInterface;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ApplicationInstanceID
    {
        class Program
        {
            private Guid applicationInstanceId;
    
            static public Guid ApplicationInstanceId { get; set; }
    
            static void Main(string[] args)
            {
    
                ApplicationInstanceId = MyReflection.Start();
    
                Application app = MyReflection.CreateApplication();
    
                //Open sessions and perform tasks...
    
    
                //Close Reflection
                try
                {
                    app.Close(ApplicationCloseOption.CloseNoSave);
                }
                catch
                {
                    MyReflection.ForceStop(ApplicationInstanceId);
                }
    
    
                Console.ReadLine();
            }
        }
    }
    
    See Also