Click or drag to resize

Application Class

The Application class provides access to global application properties and documents.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.Runtime.InteropServicesStandardOleMarshalObject
      BaseObject
        Easymap.AddInApplication

Namespace: Easymap.AddIn
Assembly: EasyMap.AddIn (in EasyMap.AddIn.dll) Version: 12.3.0.0
Syntax
public sealed class Application : BaseObject

The Application type exposes the following members.

Properties
 NameDescription
Public propertyStatic memberApplicationEvents Defines several application events, which can be binded.
Public propertyCommands Collection of Command Items.
Public propertyCompatibleDocumentVersion Returns last compatible document version
Public propertyStatic memberCurrent The current instance of the running Application.
Public propertyCurrentDocument Returns the current active Document.
Public propertyDocuments Collection of all open documents.
Public propertyDocumentVersion Returns the current document version.
Public propertyIcon The application icon.
Public propertyIsDemoVersion True if there is no valid license.
Public propertyLicenseCompanyName Returns the company name of issued license
Public propertySettings Application settings
Public propertyShow Shows the main window.
Public propertyVersion Returns the program version.
Public propertyVersionString Returns the program version in the format [programname] [version] [date].
Top
Methods
 NameDescription
Public methodAddLicense(String, String) Add a license for a specific feature.
Public methodAddLicense(Type, String) Add a license for a specific feature.
Public methodLock Locks the Application. The Application will terminate when the lockcount goes to zero.
Public methodUnLock Unlocks the Application. The Application will terminate when the lockcount goes to zero.
Top
Events
 NameDescription
Public eventDocumentAdded Fired when an document is added.
Public eventDocumentRemoved Fired when an document is removed.
Public eventFindFile Handler for file requests.
Public eventUnhandledException Provides a way to Handle unhandled exceptions.
Top
Remarks
Use the static Property Application.Current to access the running instance of the application.
Example
This sample loads an document and exports the currrent sheet to an png-image.
C#
public void DoWork()
{
    Document doc = Application.Current.Documents.CreateDoc("filename.empx", true, true);

    ImageFormatInfo info = doc.Export.CreateImageFormatInfo(ImageFormat.PNG);
    info.Filename = "Export.png";
    info.ImageHeight = 800;
    info.ExportRoot = doc.CurrentSheet;

    doc.Export.ExportImage(info);

    doc.Close();
}
See Also