public void Initialize() { try { _schemeChanginLock.EnterWriteLock(); Debug.Assert(_schemas != null); var set = _builder.GetSchemas(); _allSchemas = _schemas.Aggregate(set, (a, s) => { var readScheme = s.GetReadScheme(); Debug.Assert(readScheme != null); a.Add(readScheme); return(a); } ); _allSchemas.ValidationEventHandler += _allSchemas_ValidationEventHandler; _allSchemas.Compile(); PrepareElements(); } finally { _schemeChanginLock.ExitWriteLock(); } }