public void AddParameterPage(Page page, UseToReplaceIn useToReplaceIn, string replaceValue, string replaceWith) { var pInPage = new ParameterInPage(this, page, ParameterContext.Default, useToReplaceIn, replaceValue, replaceWith); if (FindMatchingParameterInPage(pInPage) == null) { UsedInPPages.Add(pInPage); } }
public void AddParameterPage(Page page, UseToReplaceIn useToReplaceIn, ParameterContext pContext) { var pInPage = new ParameterInPage(this, page, pContext, useToReplaceIn); if (FindMatchingParameterInPage(pInPage) == null) { UsedInPPages.Add(pInPage); } }
public ParameterInPage(Parameter parameter, Page page, ParameterContext parameterContext, UseToReplaceIn parameterTarget, string replaceValue, string replaceWith) { _p = parameter; Page = page; ParameterTarget = parameterTarget; ContextWhereParameterIsUsed = parameterContext; Replacement = new Replacement(replaceWith, replaceValue); }
public ParameterInPage(Parameter parameter, Page page, ParameterContext parameterContext, UseToReplaceIn parameterTarget) { _p = parameter; Page = page; ParameterTarget = parameterTarget; ContextWhereParameterIsUsed = parameterContext; string replaceValue, replaceWith; CalculateReplacementFromContext(out replaceValue, out replaceWith); Replacement = new Replacement(replaceWith, replaceValue); }
public void AddParameterToUse(Parameter parameter, UseToReplaceIn useToReplaceIn, ParameterContext pContext) { if (parameter == null) { return; } // Problem: When the Page has more than one follower, and two of them use the same variable, they may be repeated // Solution: Add only if the parameter is not in the list. if (!_parametersToUse.Any(p => p.VariableName == parameter.VariableName && p.AreValuesTheSame(parameter))) { _parametersToUse.Add(parameter); } parameter.AddParameterPage(this, useToReplaceIn, pContext); }
public ParameterInPage GetFirstParameterPagesOfPageAndType(Page page, UseToReplaceIn useToReplaceIn) { return(UsedInPPages.FirstOrDefault(p => p.Page == page && p.ParameterTarget == useToReplaceIn)); }