Beispiel #1
0
        private static void ImportPriv(PwGroup pgStorage, Stream s, GxiProfile p,
                                       PwDatabase pdContext, IStatusLogger sl)
        {
            StrEncodingInfo sei = StrUtil.GetEncoding(p.Encoding);
            StreamReader    srRaw;

            if ((sei != null) && (sei.Encoding != null))
            {
                srRaw = new StreamReader(s, sei.Encoding, true);
            }
            else
            {
                srRaw = new StreamReader(s, true);
            }
            string strDoc = srRaw.ReadToEnd();

            srRaw.Close();

            strDoc = Preprocess(strDoc, p);

            using (StringReader srDoc = new StringReader(strDoc))
            {
                using (XmlReader xr = XmlReader.Create(srDoc,
                                                       XmlUtilEx.CreateXmlReaderSettings()))
                {
                    XPathDocument xd = new XPathDocument(xr);

                    GxiContext c = new GxiContext(p, pdContext, pgStorage, null);

                    XPathNavigator xpDoc = xd.CreateNavigator();
                    ImportObject(xpDoc, p, p.RootXPath, "/*", GxiImporter.ImportRoot, c);
                }
            }
        }