Example #1
0
        public static XmlElement LoadDocument(string xmlPath)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(xmlPath);

            return doc.GetDocumentElement();
        }
Example #2
0
        public static XmlElement TryLoadDocument(string xmlPath)
        {
            if (!File.Exists(xmlPath))
                return null;

            XmlDocument doc = new XmlDocument();
            doc.Load(xmlPath);

            return doc.GetDocumentElement();
        }
Example #3
0
        private FFXIIITextEncoding ReadEncoding(BinaryReader br)
        {
            int length = br.ReadInt32();
            OnProgress(4);

            using (MemoryStream ms = new MemoryStream(length))
            {
                byte[] buff = new byte[4096];
                br.BaseStream.CopyToStream(ms, length, buff);
                ms.Position = 0;

                XmlDocument doc = new XmlDocument();
                doc.Load(ms);

                OnProgress(length);

                FFXIIICodePage codepage = FFXIIICodePageHelper.FromXml(doc.GetDocumentElement());
                return new FFXIIITextEncoding(codepage);
            }
        }