One plugin and some codes explanation – Encompass

Here are some codes of an Encompass plugin. There are some great seniors and friends who helped you at any stage. Thanks Michael, Zachary, Larry, Nikolai and few more.

This class appears to be implementing functionality related to milestones in a software application, potentially a mortgage or loan processing application, given the references to “Encompass” and loan-related terminology. Let me break down the key components and functionality of this class:

1. **Initialization and Event Handling**: The class constructor initializes the plugin. It subscribes to two events, `LoanOpened` and `LoanClosing`, provided by an object called `EncompassApplication`. This suggests that this plugin is meant to respond to events related to loans within the application.

2. **Loan Screen Initialization**: It attempts to get a reference to a loan screen using the `GetLoanScreen()` method. If successful, it subscribes to the `FormLoaded` event of the loan screen.

3. **FormLoaded Event Handling**: When the loan form is loaded, it calls the `LoanScreen_FormLoaded` method.

4. **FormPopup Method**: The `FormPopup` method is empty except for a check to see if there are any controls of type `RuntimeControl` on the form. If there are none, it returns early.

5. **EncompassApplication_LoanOpened Event Handling**: This event handler is triggered when a loan is opened. It subscribes to the `MilestoneCompleted` event of the current loan.

6. **CurrentLoan_MilestoneCompleted Event Handling**: This event handler is called when a milestone is completed in the current loan. It checks if the milestone name is “Submitted to Processing” and, if so, it displays a popup message using the `Macro.Popup` method.

7. **Commented-Out Code**: There are several lines of code that are commented out (with `//`), indicating that they are not currently active. These lines appear to be related to displaying message boxes and additional popups based on different milestones.

8. **GetLoanScreen Method**: This method attempts to find a loan screen in the `EncompassApplication.Screens` collection. It filters the screens to find one with a `ScreenType` equal to `EncompassScreen.Loans`.

It seems like this code is part of a custom plugin for the Encompass application, which is used in the mortgage or loan industry. The plugin listens for specific loan-related events and responds to them by displaying popups or potentially triggering other actions. The code includes some placeholder comments (“TODO”) that suggest further development or customization is expected. It’s worth noting that the commented-out code may indicate that some features are under development or being considered for future use.

[Plugin] public class MilestonePlugin
{
public MilestonePlugin()
{
EncompassApplication.LoanOpened += EncompassApplication_LoanOpened;
EncompassApplication.LoanClosing -= EncompassApplication_LoanOpened;
LoansScreen loanScreen = this.GetLoanScreen();
if (loanScreen == null)
return;
loanScreen.FormLoaded += new FormChangeEventHandler(this.LoanScreen_FormLoaded);
}
private void LoanScreen_FormLoaded(object sender, FormChangeEventArgs e) => this.FormPopup(e.Form);

private void FormPopup(EllieMae.Encompass.Forms.Form form)
{

EllieMae.Encompass.Forms.Control[] controlsByType = form.FindControlsByType(typeof(RuntimeControl));
if (controlsByType == null || controlsByType.Length == 0)
return;

}

private void EncompassApplication_LoanOpened(object sender, EventArgs e)
{
EncompassApplication.CurrentLoan.MilestoneCompleted += CurrentLoan_MilestoneCompleted;
}

private void CurrentLoan_MilestoneCompleted(object source, MilestoneEventArgs e)
{

if (e.MilestoneEvent.MilestoneName == “Submitted to Processing”)
{

Macro.Popup(“!PopupV”, string.Empty, 809, 896);

// Macro.GoToForm(“!PopupV”);
}

 

}

private LoansScreen GetLoanScreen() => EncompassApplication.Screens.OfType<LoansScreen>().FirstOrDefault<LoansScreen>((Func<LoansScreen, bool>)(screen => screen.ScreenType == EncompassScreen.Loans));
}

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.