LoadSchema() 공개 메소드

public LoadSchema ( Stream stream ) : void
stream Stream
리턴 void
예제 #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;
 }
예제 #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);
        }