コード例 #1
0
ファイル: FamilyXProvider.cs プロジェクト: m-kosina/GEDKeeper
        public override void LoadFromStreamExt(Stream fileStream, Stream inputStream, bool charsetDetection = false)
        {
#if !NETSTANDARD
            using (Package package = Package.Open(inputStream, FileMode.Open, FileAccess.Read)) {
                PackagePart documentPart = package.GetPart(new Uri("/" + OPCContentFileName, UriKind.Relative));
                using (MemoryStream memStream = new MemoryStream()) {
                    OPCUtility.CopyStream(documentPart.GetStream(), memStream);
                    memStream.Position = 0;

                    LoadFromReader(memStream, null, null);
                }
            }
#endif
        }
コード例 #2
0
        public override void LoadFromStreamExt(Stream fileStream, Stream inputStream, bool charsetDetection = false)
        {
#if !NETSTANDARD
            using (Package package = Package.Open(inputStream, FileMode.Open, FileAccess.Read)) {
                PackagePart documentPart = package.GetPart(new Uri("/" + OPCContentFileName, UriKind.Relative));
                using (MemoryStream memStream = new MemoryStream()) {
                    OPCUtility.CopyStream(documentPart.GetStream(), memStream);
                    memStream.Position = 0;

                    XmlReaderSettings settings = new XmlReaderSettings();
                    settings.DtdProcessing = DtdProcessing.Ignore;
                    using (XmlReader xr = XmlReader.Create(memStream, settings)) {
                    }
                }
            }
#endif
        }