/// <summary> /// Builds a single condition element /// </summary> /// <param name="project">Project</param> /// <param name="condition">Current Condition</param> /// <param name="errorCollection">Error Collection</param> /// <param name="flexFieldObject">FlexField to which the dialog belongs</param> /// <param name="exportSettings">Export Settings</param> /// <returns>Condition Build Result</returns> private string BuildSingleConditionElement(GoNorthProject project, ParsedConditionData condition, ExportPlaceholderErrorCollection errorCollection, FlexFieldObject flexFieldObject, ExportSettings exportSettings) { ConditionType conditionType = (ConditionType)condition.ConditionType; if (!_elementRenderes.ContainsKey(conditionType)) { errorCollection.AddDialogUnknownConditionTypeError(condition.ConditionType); return(string.Empty); } return(_elementRenderes[conditionType].BuildSingleConditionElement(condition, project, errorCollection, flexFieldObject, exportSettings)); }
/// <summary> /// Builds a single condition element /// </summary> /// <param name="project">Project</param> /// <param name="condition">Current Condition</param> /// <param name="errorCollection">Error Collection</param> /// <param name="flexFieldObject">FlexField to which the dialog belongs</param> /// <param name="exportSettings">Export Settings</param> /// <returns>Condition Build Result</returns> private async Task <string> BuildSingleConditionElement(GoNorthProject project, ParsedConditionData condition, ExportPlaceholderErrorCollection errorCollection, FlexFieldObject flexFieldObject, ExportSettings exportSettings) { ConditionType conditionType = (ConditionType)condition.ConditionType; if (!_elementRenderes.ContainsKey(conditionType)) { errorCollection.AddDialogUnknownConditionTypeError(condition.ConditionType); return(string.Empty); } string oldContext = errorCollection.CurrentErrorContext; errorCollection.CurrentErrorContext = _localizer["ErrorContextCondition", _conditionTranslator.TranslateConditionType(conditionType)]; try { return(await _elementRenderes[conditionType].BuildSingleConditionElement(condition, project, errorCollection, flexFieldObject, exportSettings)); } catch (Exception ex) { errorCollection.AddException(ex); return("<<ERROR_RENDERING_CONDITION>>"); } finally { errorCollection.CurrentErrorContext = oldContext; } }