LoadSchema() public method

public LoadSchema ( Stream stream ) : void
stream Stream
return void
Example #1
0
 public static XmlValidator LoadFromManifestResource(Assembly resourceOwner, string manifestResourceName)
 {
     if (manifestResourceName == null)
         throw new ArgumentNullException("manifestResourceName");
     if (resourceOwner == null)
         throw new ArgumentNullException("resourceOwner");
     Stream stream = resourceOwner.GetManifestResourceStream(manifestResourceName);
     if (stream == null)
         throw new ArgumentException(String.Concat("Resource is not found. Assembly: ", resourceOwner.FullName, ", Resource name: ", manifestResourceName));
     XmlValidator schema = new XmlValidator();
     schema.LoadSchema(stream);
     return schema;
 }
Example #2
0
        public static XmlValidator LoadFromManifestResource(Assembly resourceOwner, string manifestResourceName)
        {
            if (manifestResourceName == null)
            {
                throw new ArgumentNullException("manifestResourceName");
            }
            if (resourceOwner == null)
            {
                throw new ArgumentNullException("resourceOwner");
            }
            Stream stream = resourceOwner.GetManifestResourceStream(manifestResourceName);

            if (stream == null)
            {
                throw new ArgumentException(String.Concat("Resource is not found. Assembly: ", resourceOwner.FullName, ", Resource name: ", manifestResourceName));
            }
            XmlValidator schema = new XmlValidator();

            schema.LoadSchema(stream);
            return(schema);
        }