/// <summary>
        /// Add JSON to the options object if it is not there. This is used in cases where an analysis
        /// doesn't request the JSON result, but the result is needed for analysis (ie source line mapping)
        /// </summary>
        /// <param name="options"></param>
        /// <param name="other"></param>
        /// <returns></returns>
        private bool TryAddJsonToOptions(IApiPortOptions options, out IApiPortOptions other)
        {
            var outputs = new HashSet <string>(options.OutputFormats, StringComparer.OrdinalIgnoreCase);

            if (outputs.Contains(Json))
            {
                other = options;
                return(false);
            }
            else
            {
                outputs.Add(Json);

                other = new ReadWriteApiPortOptions(options)
                {
                    OutputFormats = outputs
                };

                return(true);
            }
        }
Пример #2
0
        /// <summary>
        /// Add JSON to the options object if it is not there. This is used in cases where an analysis
        /// doesn't request the JSON result, but the result is needed for analysis (ie source line mapping)
        /// </summary>
        /// <param name="options"></param>
        /// <param name="other"></param>
        /// <returns></returns>
        private bool TryAddJsonToOptions(IApiPortOptions options, out IApiPortOptions other)
        {
            var outputs = new HashSet<string>(options.OutputFormats, StringComparer.OrdinalIgnoreCase);

            if (outputs.Contains(Json))
            {
                other = options;
                return false;
            }
            else
            {
                outputs.Add(Json);

                other = new ReadWriteApiPortOptions(options)
                {
                    OutputFormats = outputs
                };

                return true;
            }
        }