public static IDisposable NoIndent(this CSharpCodeWriter writer)
        {
            var currentIndent = writer.CurrentIndent;

            writer.ResetIndent();
            var scope = new ActionScope(() =>
            {
                writer.SetIndent(currentIndent);
            });

            return(scope);
        }
Ejemplo n.º 2
0
        public LinePragmaWriter(CSharpCodeWriter writer, MappingLocation documentLocation)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            if (documentLocation == null)
            {
                throw new ArgumentNullException(nameof(documentLocation));
            }

            _writer      = writer;
            _startIndent = _writer.CurrentIndent;
            _writer.ResetIndent();
            _writer.WriteLineNumberDirective(documentLocation, documentLocation.FilePath);
            _writer.SetIndent(_startIndent);
        }