GetArguments() public method

Substitutes the key placeholders with their respective values.
public GetArguments ( Scope keyScope, Scope contextScope ) : object>.Dictionary
keyScope Scope The key/value pairs in the current lexical scope.
contextScope Scope The key/value pairs in current context.
return object>.Dictionary
Beispiel #1
0
        void IGenerator.GetText(TextWriter writer, Scope keyScope, Scope contextScope, Action <Substitution> postProcessor)
        {
            Dictionary <string, object> arguments = _arguments.GetArguments(keyScope, contextScope);
            IEnumerable <NestedContext> contexts  = _definition.GetChildContext(writer, keyScope, arguments, contextScope);
            List <IGenerator>           generators;

            if (_definition.ShouldGeneratePrimaryGroup(arguments))
            {
                generators = _primaryGenerators;
            }
            else
            {
                generators = new List <IGenerator>();
                if (_subGenerator != null)
                {
                    generators.Add(_subGenerator);
                }
            }
            foreach (NestedContext context in contexts)
            {
                foreach (IGenerator generator in generators)
                {
                    generator.GetText(context.Writer ?? writer, context.KeyScope ?? keyScope, context.ContextScope, postProcessor);
                    if (context.WriterNeedsConsidated)
                    {
                        writer.Write(_definition.ConsolidateWriter(context.Writer ?? writer, arguments));
                    }
                }
            }
        }
Beispiel #2
0
 private Dictionary <string, object> GetArguments(Scope scope, Scope context)
 {
     if (_definition.IsSetter)
     {
         return(_arguments.GetArgumentKeyNames());
     }
     else
     {
         return(_arguments.GetArguments(scope, context));
     }
 }
Beispiel #3
0
 void IGenerator.GetText(Scope scope, TextWriter writer, Scope context)
 {
     Dictionary<string, object> arguments;
     if (_definition.IsSetter)
     {
         arguments = _arguments.GetArgumentKeyNames();   
     }
     else
     {
         arguments = _arguments.GetArguments(scope, context);
     }            
     _definition.GetText(writer, arguments, context);
 }
        void IGenerator.GetText(TextWriter writer, Scope scope, Scope context, Action <Substitution> postProcessor)
        {
            Dictionary <string, object> arguments;

            if (_definition.IsSetter)
            {
                arguments = _arguments.GetArgumentKeyNames();
            }
            else
            {
                arguments = _arguments.GetArguments(scope, context);
            }
            _definition.GetText(writer, arguments, context);
        }
Beispiel #5
0
        void IGenerator.GetText(Scope scope, TextWriter writer, Scope context)
        {
            Dictionary <string, object> arguments;

            if (_definition.IsSetter)
            {
                arguments = _arguments.GetArgumentKeyNames();
            }
            else if (_definition is CommandTagDefinition)
            {
                arguments = new Dictionary <string, object>();
                foreach (var pair in _arguments.LookupDictionary)
                {
                    arguments.Add(pair.Key.Name, pair.Value);
                }
            }
            else
            {
                arguments = _arguments.GetArguments(scope, context);
            }

            _definition.GetText(writer, arguments, context);
        }