Пример #1
0
        public static string GetEffectiveConfigAsString(string workingDirectory, IFileSystem fileSystem)
        {
            var config        = Provide(workingDirectory, fileSystem);
            var stringBuilder = new StringBuilder();

            using (var stream = new StringWriter(stringBuilder))
            {
                ConfigSerialiser.Write(config, stream);
                stream.Flush();
            }
            return(stringBuilder.ToString());
        }
        private static string GetOverrideConfigHash(Config overrideConfig)
        {
            if (overrideConfig == null)
            {
                return(string.Empty);
            }

            // Doesn't depend on command line representation and
            // includes possible changes in default values of Config per se.
            var stringBuilder = new StringBuilder();

            using (var stream = new StringWriter(stringBuilder))
            {
                ConfigSerialiser.Write(overrideConfig, stream);
                stream.Flush();
            }
            var configContent = stringBuilder.ToString();

            return(GetHash(configContent));
        }