Пример #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);
        }
Пример #2
0
        public 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");
        }