public IResolvedToken Resolve(FluTeCoreInstance template) { var inputObject = new MultiInput(template, Inputs); var value = Inputs.Count() == 1 ? Processing.Invoke(inputObject[0]) : Processing.Invoke(inputObject); return(new ResolvedToken(this, value.ToString())); }
public MultiInput(FluTeCoreInstance parent, IEnumerable <InputReference> inputs) { inputDictionary = new Dictionary <string, object>(); foreach (var inRef in inputs) { inputDictionary.Add(inRef.LocalName, inRef.Resolve(parent)); } this.inputs = inputs.Select(x => x.Resolve(parent)).ToList(); }
/// <summary> /// Resolves the input reference against the specified parent template. E.g. resolves the internally referenced input, and preprocesses this value as appropriate. /// </summary> /// <param name = "template"></param> /// <returns></returns> public object Resolve(FluTeCoreInstance template) { if (template.Inputs.ContainsKey(Key)) { var input = (IBoundInput)template.Inputs[Key]; return(PreProcessing.Invoke(input.Value)); } else { throw new KeyNotFoundException("An input reference tried to resolve an input that doesn't exist in the template."); } }
internal static FluTeInstance Convert(this FluTeCoreInstance flute) { return(new FluTeInstance(flute)); }
internal FluTeInstance(FluTeCoreInstance innerTemplate) { this.innerTemplate = innerTemplate; }