/// <summary>
        /// Get the cached instance with schema validator prepared with loaded schemas from disk
        /// Create one if the first time.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="cachekey">optional cachekey to enable different validatorsets in cache</param>
        /// <returns></returns>
        public static SchemaValidator GetSchemaValidator(string path, string cachekey = null)
        {
            SchemaValidator validator = GetSchemaValidator(path + cachekey);

            if (validator == null)
            {
                lock (lockObject)
                {
                    validator = new SchemaValidator(path);

                    SchemaValidator.CacheSchemaValidator(validator, cachekey);
                }
            }

            return(validator);
        }
        public StmSchemaValidator()
        {
            lock (lockobject)
            {
                validator = SchemaValidator.GetSchemaValidator(cachekey);
                if (validator == null)
                {
                    var schemaAssembly = Assembly.GetAssembly(typeof(STM.Common.Schema.Schema));
                    var names          = schemaAssembly.GetManifestResourceNames();
                    names = names.OrderBy(x => x).ToArray();

                    validator = new SchemaValidator(schemaAssembly, names.ToList());
                    SchemaValidator.CacheSchemaValidator(validator, cachekey);
                }
            }
        }