/// <summary>
        /// Gets the delimited poarameter if it needs delimitation and is not delimited
        /// </summary>
        /// <param name="parameterValue">value needing delimitation</param>
        /// <param name="openDelimiter">open delimitation</param>
        /// <param name="closeDelimiter">close delimitation</param>
        /// <returns>the delimited poarameter if it needs delimitation and is not delimited</returns>
        private static string GetDelimitedParameter(string parameterValue, string openDelimiter, string closeDelimiter)
        {
            string parameterValueTrimmed = parameterValue.Trim();

            if (parameterValueTrimmed.Length == 0)
            {
                return(openDelimiter + parameterValue + closeDelimiter);
            }

            char delimitationChar = ParameterSetViewModel.ParameterNeedsDelimitation(parameterValueTrimmed, openDelimiter.Length == 1 && openDelimiter[0] == '{');

            switch (delimitationChar)
            {
            case '1':
                return(openDelimiter + parameterValue + closeDelimiter);

            case '\'':
                return('\'' + parameterValue + '\'');

            case '\"':
                return('\"' + parameterValue + '\"');

            default:
                Diagnostics.Assert(delimitationChar == '0', "all other possible return values are in the cases above");
                return(parameterValueTrimmed);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets the delimited poarameter if it needs delimitation and is not delimited.
        /// </summary>
        /// <param name="parameterValue">Value needing delimitation.</param>
        /// <param name="openDelimiter">Open delimitation.</param>
        /// <param name="closeDelimiter">Close delimitation.</param>
        /// <returns>The delimited poarameter if it needs delimitation and is not delimited.</returns>
        private static string GetDelimitedParameter(string parameterValue, string openDelimiter, string closeDelimiter)
        {
            string parameterValueTrimmed = parameterValue.Trim();

            if (parameterValueTrimmed.Length == 0)
            {
                return(openDelimiter + parameterValue + closeDelimiter);
            }

            char delimitationChar = ParameterSetViewModel.ParameterNeedsDelimitation(parameterValueTrimmed, openDelimiter.Length == 1 && openDelimiter[0] == '{');

            switch (delimitationChar)
            {
            case '1':
                return(openDelimiter + parameterValue + closeDelimiter);

            case '\'':
                return('\'' + parameterValue + '\'');

            case '\"':
                return('\"' + parameterValue + '\"');

            default:
                return(parameterValueTrimmed);
            }
        }