コード例 #1
0
ファイル: XmlValidator.cs プロジェクト: maxpavlov/FlexNet
 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
ファイル: XmlValidator.cs プロジェクト: y1027/sensenet
        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);
        }