public override bool FullScriptStage(ISourceScript file, ISourceManager sourceManager, IDefinitions defs) { if (!file.HasValueOfType <string[]>("genParams")) { return(true); //No error, we just dont have any generic parameters to replace. } string[] genParams = file.GetValueFromCache <string[]>("genParams"); Logger.Log(PPLogType.Log, Verbosity.Level5, "Discovering Generic Keywords..."); if (genParams != null && genParams.Length > 0) { for (int i = genParams.Length - 1; i >= 0; i--) { Logger.Log(PPLogType.Log, Verbosity.Level6, "Replacing Keyword {0}{1} with {2} in file {3}", GenericKeyword, i, genParams[i], file.GetKey()); Utils.ReplaceKeyWord(file.GetSource(), genParams[i], GenericKeyword + i); } } Logger.Log(PPLogType.Log, Verbosity.Level5, "Generic Keyword Replacement Finished"); return(true); }
public override bool FullScriptStage(ISourceScript file, ISourceManager sourceManager, IDefinitions defs) { if (!file.HasValueOfType <string[]>("genParams")) { return(true); //No error, we just dont have any generic parameters to replace. } string[] genParams = file.GetValueFromCache <string[]>("genParams"); Logger.Log(LogType.Log, "Discovering Generic Keywords...", PLUGIN_MIN_SEVERITY); if (genParams != null && genParams.Length > 0) { for (int i = genParams.Length - 1; i >= 0; i--) { Logger.Log(LogType.Log, $"Replacing Keyword {GenericKeyword}{i} with {genParams[i]} in file {file.GetKey()}", PLUGIN_MIN_SEVERITY + 1); Utils.ReplaceKeyWord(file.GetSource(), genParams[i], GenericKeyword + i); } } Logger.Log(LogType.Log, "Generic Keyword Replacement Finished", PLUGIN_MIN_SEVERITY); return(true); }
public bool FullScriptStage(ISourceScript file, ISourceManager sourceManager, IDefinitions defs) { if (!file.HasValueOfType <string[]>("genParams")) { return(true); //No error, we just dont have any generic parameters to replace. } string[] GenParams = file.GetValueFromCache <string[]>("genParams"); this.Log(DebugLevel.LOGS, Verbosity.LEVEL5, "Discovering Generic Keywords..."); if (GenParams != null && GenParams.Length > 0) { for (var i = GenParams.Length - 1; i >= 0; i--) { this.Log(DebugLevel.LOGS, Verbosity.LEVEL6, "Replacing Keyword {0}{1} with {2} in file {3}", GenericKeyword, i, GenParams[i], file.GetKey()); Utils.ReplaceKeyWord(file.GetSource(), GenParams[i], GenericKeyword + i); } } this.Log(DebugLevel.LOGS, Verbosity.LEVEL5, "Generic Keyword Replacement Finished"); return(true); }