/// <summary> /// Creates a NAnt Schema for given types /// </summary> /// <param name="stream">The output stream to save the schema to. If <see langword="null" />, writing is ignored, no exception generated.</param> /// <param name="tasks">The list of tasks to generate XML Schema for.</param> /// <param name="dataTypes">The list of datatypes to generate XML Schema for.</param> /// <param name="targetNS">The target namespace to output.</param> /// <returns>The new NAnt Schema.</returns> public static XmlSchema WriteSchema(System.IO.Stream stream, Type[] tasks, Type[] dataTypes, string targetNS) { NAntSchemaGenerator gen = new NAntSchemaGenerator(tasks, dataTypes, targetNS); if (!gen.Schema.IsCompiled) { gen.Compile(); } if (stream != null) { gen.Schema.Write(stream); } return(gen.Schema); }
/// <summary> /// Creates a NAnt Schema for given types /// </summary> /// <param name="stream">The output stream to save the schema to. If <see langword="null" />, writing is ignored, no exception generated.</param> /// <param name="tasks">The list of tasks to generate XML Schema for.</param> /// <param name="dataTypes">The list of datatypes to generate XML Schema for.</param> /// <param name="targetNS">The target namespace to output.</param> /// <returns>The new NAnt Schema.</returns> public static XmlSchema WriteSchema(System.IO.Stream stream, List <Type> tasks, List <Type> dataTypes, List <Type> attributeTypes, List <String> propertyNames, List <String> targetNames, string targetNS) { NAntSchemaGenerator gen = new NAntSchemaGenerator(tasks, dataTypes, attributeTypes, propertyNames, targetNames, targetNS); if (!gen.Schema.IsCompiled) { gen.Compile(); } if (stream != null) { gen.Schema.Write(stream); } return(gen.Schema); }
/// <summary> /// Creates a NAnt Schema for given types /// </summary> /// <param name="stream">The output stream to save the schema to. If <see langword="null" />, writing is ignored, no exception generated.</param> /// <param name="tasks">The list of tasks to generate XML Schema for.</param> /// <param name="dataTypes">The list of datatypes to generate XML Schema for.</param> /// <param name="targetNS">The target namespace to output.</param> /// <returns>The new NAnt Schema.</returns> public static XmlSchema WriteSchema(System.IO.Stream stream, Type[] tasks, Type[] dataTypes, string targetNS) { NAntSchemaGenerator gen = new NAntSchemaGenerator(tasks, dataTypes, targetNS); if (!gen.Schema.IsCompiled) { gen.Compile(); } if (stream != null) { gen.Schema.Write(stream); } return gen.Schema; }