private void ExpandVariables(IDictionary <string, object> expandableProperties) { var modifiedProperties = new Dictionary <string, object>(); if (variableExpansions != null && variableExpansions.Count > 0) { Log.Debug("Expanding variables. {0} properties to check for {1} defined variables.", expandableProperties.Count, variableExpansions.Count); foreach (KeyValuePair <string, object> kvp in expandableProperties) { object expanded = ExpandableVars.ExpandAllForProperty(kvp.Key, kvp.Value, variableExpansions, GetPropertyDefinition); modifiedProperties[kvp.Key] = expanded; } foreach (KeyValuePair <string, object> kvp in modifiedProperties) { expandableProperties[kvp.Key] = kvp.Value; } } else { Log.Debug("No expandable variables set... skipping expansion of {0} read properties.", expandableProperties.Count); } }
public Settings ExpandVariablesInCopy() { var copy = new Dictionary <string, object>(properties); foreach (string propertyName in properties.Keys) { copy[propertyName] = ExpandableVars.ExpandAllForProperty(propertyName, copy[propertyName], ExpandableVars.Instance.Variables, PropertyDefinitionGetter); } return(new Settings(copy, PropertyDefinitionGetter)); }