/// <summary> /// Fills the placeholders /// </summary> /// <param name="template">Template to use</param> /// <param name="errorCollection">Error Collection</param> /// <param name="parsedData">Parsed config data</param> /// <param name="directContinueFunction">Direct continue function</param> /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param> /// <param name="curStep">Current step that is rendered</param> /// <param name="nextStep">Next step that is being rendered</param> /// <param name="stepRenderer">Action Step renderer</param> /// <returns>Filled placeholders</returns> protected override async Task <string> FillPlaceholders(ExportTemplate template, ExportPlaceholderErrorCollection errorCollection, WaitActionData parsedData, string directContinueFunction, FlexFieldObject flexFieldObject, ExportDialogData curStep, ExportDialogData nextStep, IActionStepRenderer stepRenderer) { string actionCode = ExportUtil.BuildPlaceholderRegex(Placeholder_Wait_Amount).Replace(template.Code, parsedData.WaitAmount.ToString()); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitTypeIsRealTime_Start, Placeholder_WaitTypeIsRealTime_End, parsedData.WaitType == WaitActionData.WaitTypeRealTime); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitTypeIsGameTime_Start, Placeholder_WaitTypeIsGameTime_End, parsedData.WaitType == WaitActionData.WaitTypeGameTime); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitUnitIsMilliseconds_Start, Placeholder_WaitUnitIsMilliseconds_End, parsedData.WaitUnit == WaitActionData.WaitUnitMilliseconds); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitUnitIsSeconds_Start, Placeholder_WaitUnitIsSeconds_End, parsedData.WaitUnit == WaitActionData.WaitUnitSeconds); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitUnitIsMinutes_Start, Placeholder_WaitUnitIsMinutes_End, parsedData.WaitUnit == WaitActionData.WaitUnitMinutes); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitUnitIsHours_Start, Placeholder_WaitUnitIsHours_End, parsedData.WaitUnit == WaitActionData.WaitUnitHours); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_WaitUnitIsDays_Start, Placeholder_WaitUnitIsDays_End, parsedData.WaitUnit == WaitActionData.WaitUnitDays); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_HasDirectContinueFunction_Start, Placeholder_HasDirectContinueFunction_End, !string.IsNullOrEmpty(directContinueFunction)); actionCode = ExportUtil.RenderPlaceholderIfTrue(actionCode, Placeholder_HasNoDirectContinueFunction_Start, Placeholder_HasNoDirectContinueFunction_End, string.IsNullOrEmpty(directContinueFunction)); actionCode = ExportUtil.BuildPlaceholderRegex(Placeholder_DirectContinueFunction).Replace(actionCode, directContinueFunction); return(await stepRenderer.ReplaceBasePlaceholders(errorCollection, actionCode, curStep, nextStep, flexFieldObject)); }
/// <summary> /// Fills the placeholders /// </summary> /// <param name="template">Template to use</param> /// <param name="errorCollection">Error Collection</param> /// <param name="parsedData">Parsed config data</param> /// <param name="directContinueFunction">Direct continue function</param> /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param> /// <param name="curStep">Current step that is rendered</param> /// <param name="nextStep">Next step that is being rendered</param> /// <param name="stepRenderer">Action Step renderer</param> /// <returns>Filled placeholders</returns> protected override async Task <string> FillPlaceholders(ExportTemplate template, ExportPlaceholderErrorCollection errorCollection, WaitActionData parsedData, string directContinueFunction, FlexFieldObject flexFieldObject, ExportDialogData curStep, ExportDialogData nextStep, IActionStepRenderer stepRenderer) { ScribanWaitActionData waitActionData = new ScribanWaitActionData(); waitActionData.WaitAmount = parsedData.WaitAmount; waitActionData.WaitType = ConvertWaitType(parsedData.WaitType); waitActionData.WaitUnit = ConvertWaitUnit(parsedData.WaitUnit); waitActionData.DirectContinueFunction = !string.IsNullOrEmpty(directContinueFunction) ? directContinueFunction : null; return(await ScribanActionRenderingUtil.FillPlaceholders(_cachedDbAccess, errorCollection, template.Code, waitActionData, flexFieldObject, curStep, nextStep, null, stepRenderer)); }