Exemple #1
0
 public static void InitLoadingMetaHeaderOnly(string filePath)
 {
     using (StreamReader streamReader = new StreamReader(filePath))
     {
         using (XmlTextReader xmlTextReader = new XmlTextReader(streamReader))
         {
             if (!ScribeMetaUtility.ReadToMetaElement(xmlTextReader))
             {
                 Scribe.mode = LoadSaveMode.Inactive;
                 return;
             }
             using (XmlReader xmlReader = xmlTextReader.ReadSubtree())
             {
                 XmlDocument xmlDocument = new XmlDocument();
                 xmlDocument.Load(xmlReader);
                 XmlElement xmlElement = xmlDocument.CreateElement("root");
                 xmlElement.AppendChild(xmlDocument.DocumentElement);
                 Scribe.curParent = xmlElement;
             }
         }
     }
     Scribe.mode = LoadSaveMode.LoadingVars;
 }
Exemple #2
0
 public static bool ReadToMetaElement(XmlTextReader textReader)
 {
     return(ScribeMetaUtility.ReadToNextElement(textReader) && ScribeMetaUtility.ReadToNextElement(textReader) && !(textReader.Name != "meta"));
 }