/// <summary> /// Get the schemas required to validate a library. /// </summary> /// <returns>The schemas required to validate a library.</returns> internal static XmlSchemaCollection GetSchemas() { if (null == schemas) { Assembly assembly = Assembly.GetExecutingAssembly(); using (Stream librarySchemaStream = assembly.GetManifestResourceStream("Microsoft.Tools.WindowsInstallerXml.Xsd.libraries.xsd")) { schemas = new XmlSchemaCollection(); schemas.Add(Intermediate.GetSchemas()); schemas.Add(Localization.GetSchemas()); XmlSchema librarySchema = XmlSchema.Read(librarySchemaStream, null); schemas.Add(librarySchema); } } return(schemas); }
/// <summary> /// Get the schemas required to validate an object. /// </summary> /// <returns>The schemas required to validate an object.</returns> internal static XmlSchemaCollection GetSchemas() { lock (lockObject) { if (null == schemas) { Assembly assembly = Assembly.GetExecutingAssembly(); using (Stream outputSchemaStream = assembly.GetManifestResourceStream("Microsoft.Tools.WindowsInstallerXml.Xsd.outputs.xsd")) { schemas = new XmlSchemaCollection(); schemas.Add(Intermediate.GetSchemas()); schemas.Add(TableDefinitionCollection.GetSchemas()); XmlSchema outputSchema = XmlSchema.Read(outputSchemaStream, null); schemas.Add(outputSchema); } } } return(schemas); }