The provided code is a C# class named “DocumentPopUp,”. This class seems to be a plugin designed to interact with EllieMae’s Encompass loan origination software. Let’s break down the code:
1. **Using Statements**: This section includes several “using” directives to include external namespaces and classes that the plugin depends on. These namespaces include EllieMae.Encompass.Automation, EllieMae.Encompass.BusinessObjects, EllieMae.Encompass.Forms, System, and System.Windows.Forms. These namespaces provide access to various functionalities and classes required for interacting with Encompass and Windows Forms.
2. **Plugin Attribute**: The class is marked with an attribute `[EllieMae.Encompass.ComponentModel.Plugin]`, indicating that it is a plugin for the Encompass software. This attribute is likely used to identify the class as a plugin to the Encompass application.
3. **Constructor**: The class has a constructor `DocumentPopUp()`, which is executed when an instance of the class is created. In the constructor, two event handlers are registered:
– `EncompassApplication.Login` event: This event is associated with the Encompass application’s login process. However, the `EncompassApplication_Login` method, which is supposed to handle this event, is empty.
– `EncompassApplication.LoanOpened` event: This event is triggered when a loan is opened in the Encompass application. The `EncompassApplication_LoanOpened` method handles this event.
4. **Error Handling**: Inside the constructor, there is a try-catch block. If an exception occurs during the registration of the event handlers, the exception message is shown in a message box.
5. **Event Handlers**:
– `EncompassApplication_Login`: This method is intended to handle the Encompass application’s login event. However, it is empty and doesn’t contain any logic.
– `EncompassApplication_LoanOpened`: This method is called when a loan is opened in the Encompass application. Within this method:
– It subscribes to the `Committed` event of the current loan object. This event is presumably related to when a loan is marked as “committed” within the application.
– It calls the `GetLoanScreen` method to retrieve the loan screen. If the loan screen is found, it subscribes to the `FormLoaded` event of the loan screen, presumably to perform actions when the loan form is loaded.
6. **GetLoanScreen Method**: This method is not provided in the code snippet, but it is called to obtain a reference to a loan screen. This reference is used in the `EncompassApplication_LoanOpened` method to subscribe to the `FormLoaded` event.
Overall, this class appears to be a plugin for the Encompass loan origination software, and it is designed to handle events related to loan activities, such as login and loan opening. The actual functionality of the plugin, including what it does when these events occur, is not included in the provided code snippet. The code seems to be a part of a larger system where additional logic and functionality may be implemented elsewhere.
using EllieMae.Encompass.Automation;
using EllieMae.Encompass.BusinessObjects;
using EllieMae.Encompass.Forms;
using System;
using System.Linq;
using System.Windows.Forms;
namespace DocumentPopup.Plugin
{
[EllieMae.Encompass.ComponentModel.Plugin]
public class DocumentPopUp
{
public DocumentPopUp()
{
try
{
EncompassApplication.Login += new EventHandler(this.EncompassApplication_Login);
EncompassApplication.LoanOpened += new EventHandler(this.EncompassApplication_LoanOpened);
}
catch (Exception ex)
{
int num = (int) MessageBox.Show(ex.Message);
}
}
private void EncompassApplication_Login(object sender, EventArgs e)
{
}
private void EncompassApplication_LoanOpened(object sender, EventArgs e)
{
EncompassApplication.CurrentLoan.Committed += new PersistentObjectEventHandler(this.CurrentLoan_Committed);
LoansScreen loanScreen = this.GetLoanScreen();
if (loanScreen == null)
return;
loanScreen.FormLoaded += new FormChangeEventHandler(this.LoanScreen_FormLoaded);
}