/// <summary> /// Change at runtime the behaviors of the selected expense /// </summary> /// <param name="currentExpenseView"></param> /// <returns></returns> public static IExpenseView DecorateExpenseView(IExpenseView currentExpenseView) { if (currentExpenseView != null) { msdyn_expense expense = currentExpenseView.GetExpense(); IExpenseView decoratedExpenseView = currentExpenseView; // Check if Receipt Decorator still valid ReceiptBehaviorView receiptBehavior = decoratedExpenseView as ReceiptBehaviorView; return(decoratedExpenseView); } return(null); }