Exemple #1
0
        internal void Write(TextWriter writer, string sectionTag)
        {
            if (SkipIfEmpty && IsEmpty)
            {
                return;
            }

            writer.Write("\t");
            writer.Write(sectionTag);
            writer.Write('(');
            writer.Write(Id);
            writer.Write(") = ");
            writer.WriteLine(FromSectionType(sectionTag == "ProjectSection", SectionType));
            if (_sectionLines != null)
            {
                foreach (var l in _sectionLines)
                {
                    writer.WriteLine("\t\t" + l);
                }
            }
            else if (_properties != null)
            {
                _properties.Write(writer);
            }
            else if (_nestedPropertySets != null)
            {
                foreach (var ps in _nestedPropertySets)
                {
                    ps.Write(writer);
                }
            }
            writer.WriteLine("\tEnd" + sectionTag);
        }
Exemple #2
0
        private void Write(TextWriter writer)
        {
            writer.NewLine = _format.NewLine;
            for (int n = 0; n < _prefixBlankLines; n++)
            {
                writer.WriteLine();
            }
            writer.WriteLine("Microsoft Visual Studio Solution File, Format Version " + FormatVersion);
            writer.WriteLine("# " + ProductDescription);

            _metadata.Write(writer);

            foreach (var p in _projects)
            {
                p.Write(writer);
            }

            writer.WriteLine("Global");
            foreach (SlnSection s in _sections)
            {
                s.Write(writer, "GlobalSection");
            }
            writer.WriteLine("EndGlobal");
        }