Opc.Ua.Schema.SchemaValidator.LoadResource C# (CSharp) 메소드

LoadResource() 보호된 정적인 메소드

Loads a schema from an embedded resource.
protected static LoadResource ( System type, string path, Assembly assembly ) : object
type System
path string
assembly System.Reflection.Assembly
리턴 object
        protected static object LoadResource(System.Type type, string path, Assembly assembly)
        {
            try
            {
                StreamReader reader = new StreamReader(assembly.GetManifestResourceStream(path));

                try
                {
                    XmlSerializer serializer = new XmlSerializer(type);
                    return serializer.Deserialize(reader);
                }
                finally
                {
                    reader.Close();
                }
            }
            catch (Exception e)
            {
                throw new FileNotFoundException(String.Format(CultureInfo.InvariantCulture, "Could not load resource '{0}'.", path), e);
            }
        }