Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public void AddParameterPage(Page page, UseToReplaceIn useToReplaceIn, ParameterContext pContext)
        {
            var pInPage = new ParameterInPage(this, page, pContext, useToReplaceIn);

            if (FindMatchingParameterInPage(pInPage) == null)
            {
                UsedInPPages.Add(pInPage);
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public ParameterInPage GetFirstParameterPagesOfPageAndType(Page page, UseToReplaceIn useToReplaceIn)
 {
     return(UsedInPPages.FirstOrDefault(p => p.Page == page && p.ParameterTarget == useToReplaceIn));
 }