internal static string ReplaceParameter(string parameter)
 {
     if (parameter == null)
     {
         return(null);
     }
     foreach (var stream in ValuesParser.GetParams(parameter))
     {
         var streamValue = string.Format("instance.parameters.{0}", stream.Substring(1, stream.Length - 2));
         parameter = parameter.Replace(stream, streamValue);
     }
     return(parameter);
 }
        private static string FormatParameterValue(IParameter param)
        {
            switch (param)
            {
            case BoolParameter boolParam:
                return(boolParam.Value ? "true" : "false");

            case IntParameter intParam:
                return(intParam.Value.ToString());

            case StringParameter stringParam:
                return($"\"{stringParam.Value}\"");

            case ExternalParameter externalParam:
                IEnumerable <string> parameterValues = ValuesParser.GetParams(externalParam.Value);
                return(ValueFormatter.ReplaceValues(externalParam.Value, parameterValues, "instance.parameters.{0}"));
            }
            throw new NotSupportedException();
        }