Exemplo n.º 1
0
        public void GenerateCommands(RegistryContext ctx, string path, CommandSerializerDelegate filter)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            Console.WriteLine("Generate registry commands to {0}.", path);

            using (SourceStreamWriter sw = new SourceStreamWriter(path, false)) {
                GenerateLicensePreamble(sw);

                // Warning CS1734  XML comment on 'method' has a paramref tag for 'param', but there is no parameter by that name
                sw.WriteLine("#pragma warning disable 1734");
                sw.WriteLine();

                sw.WriteLine("using System;");
                sw.WriteLine("using System.Diagnostics;");
                sw.WriteLine("using System.Runtime.InteropServices;");
                sw.WriteLine("using System.Text;");
                sw.WriteLine();

                sw.WriteLine("namespace OpenGL");
                sw.WriteLine("{");
                sw.Indent();

                sw.WriteLine("public partial class {0}", ctx.Class);
                sw.WriteLine("{");
                sw.Indent();

                // Function implementations
                filter(ctx, sw);

                sw.Unindent();
                sw.WriteLine("}");
                sw.Unindent();

                sw.WriteLine();
                sw.WriteLine("}");
            }
        }
Exemplo n.º 2
0
		public void GenerateCommands(RegistryContext ctx, string path, CommandSerializerDelegate filter)
		{
			if (path == null)
				throw new ArgumentNullException("path");

			Console.WriteLine("Generate registry commands to {0}.", path);

			using (SourceStreamWriter sw = new SourceStreamWriter(path, false)) {
				GenerateLicensePreamble(sw);

				// Warning CS1734  XML comment on 'method' has a paramref tag for 'param', but there is no parameter by that name
				sw.WriteLine("#pragma warning disable 1734");
				sw.WriteLine();

				sw.WriteLine("using System;");
				sw.WriteLine("using System.Diagnostics;");
				sw.WriteLine("using System.Runtime.InteropServices;");
				sw.WriteLine("using System.Text;");
				sw.WriteLine();

				sw.WriteLine("namespace OpenGL");
				sw.WriteLine("{");
				sw.Indent();

				sw.WriteLine("public partial class {0}", ctx.Class);
				sw.WriteLine("{");
				sw.Indent();

				// Function implementations
				filter(ctx, sw);

				sw.Unindent();
				sw.WriteLine("}");
				sw.Unindent();

				sw.WriteLine();
				sw.WriteLine("}");
			}
		}
Exemplo n.º 3
0
		public void GenerateCommands(RegistryContext ctx, string path, CommandSerializerDelegate filter)
		{
			if (path == null)
				throw new ArgumentNullException("path");

			Console.WriteLine("Generate registry commands to {0}.", path);

			using (SourceStreamWriter sw = new SourceStreamWriter(path, false)) {
				GenerateLicensePreamble(sw);

				sw.WriteLine();

				sw.WriteLine("using System;");
				sw.WriteLine("using System.Diagnostics;");
				sw.WriteLine("using System.Runtime.InteropServices;");
				sw.WriteLine("using System.Text;");
				sw.WriteLine();

				sw.WriteLine("namespace OpenGL");
				sw.WriteLine("{");
				sw.Indent();

				sw.WriteLine("public partial class {0}", ctx.Class);
				sw.WriteLine("{");
				sw.Indent();

				// Function implementations
				filter(ctx, sw);

				sw.Unindent();
				sw.WriteLine("}");
				sw.Unindent();

				sw.WriteLine();
				sw.WriteLine("}");
			}
		}