|
// -- FILE ------------------------------------------------------------------
// name : FormXmlSchema.cs
// project : Itenso Web User Forms
// created : Jani Giannoudis - 2008.10.30
// language : c#
// environment: .NET 2.0
// copyright : (c) 2008-2012 by Itenso GmbH, Switzerland
// --------------------------------------------------------------------------
using System.Xml;
using System.Xml.Schema;
namespace Itenso.WebUserForms.Data.Form
{
// ------------------------------------------------------------------------
public sealed class FormXmlSchema : XmlSchemaBase
{
// ----------------------------------------------------------------------
private FormXmlSchema()
{
} // FormXmlSchema
// ----------------------------------------------------------------------
public static XmlSchema Schema
{
get
{
if ( schema == null )
{
lock ( mutex )
{
if ( schema == null )
{
schema = LoadSchema( typeof( FormXmlSchema ), "Form.xsd" );
}
}
}
return schema;
}
} // Schema
// ----------------------------------------------------------------------
/// <exception cref="System.Xml.Schema.XmlSchemaException">in case of a schema error</exception>
public static XmlReaderSettings XmlReadSettings
{
get
{
if ( readSettings == null )
{
lock ( mutex )
{
if ( readSettings == null )
{
readSettings = CreateStrictSchemaValidationSettings( Schema );
}
}
}
return readSettings;
}
} // XmlReadSettings
// ----------------------------------------------------------------------
// members
private static readonly object mutex = new object();
private static volatile XmlSchema schema;
private static volatile XmlReaderSettings readSettings;
} // class FormXmlSchema
} // namespace Itenso.WebUserForms.Data.Form
// -- EOF -------------------------------------------------------------------
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
👨 Senior .NET Software Engineer
🚀 My Open Source Projects
-
Time Period Library 👉
GitHub
-
Payroll Engine 👉
GitHub
Feedback and contributions are welcome.