public bool LoadFrom(DCompilerConfiguration cmpCfg, System.Xml.XmlReader x) { if (x.ReadState == ReadState.Initial) { x.Read(); } if (x.MoveToAttribute("Target") && !Enum.TryParse(x.ReadContentAsString(), true, out TargetType)) { return(false); } while (x.Read()) { switch (x.LocalName) { // For backward compatibility keep on parsing this case "CompilerCommand": cmpCfg.SourceCompilerCommand = x.ReadString(); break; case "LinkerCommand": Linker = x.ReadString(); break; case "Patterns": // ditto var s = x.ReadSubtree(); cmpCfg.ArgumentPatterns.ReadFrom(s); s.Close(); break; case "DebugArgs": s = x.ReadSubtree(); DebugArguments.ReadFrom(cmpCfg, s); s.Close(); break; case "ReleaseArgs": s = x.ReadSubtree(); ReleaseArguments.ReadFrom(cmpCfg, s); s.Close(); break; } } return(true); }
public void LoadFrom(System.Xml.XmlReader x) { if (x.ReadState == ReadState.Initial) { x.Read(); } if (x.MoveToAttribute("Target")) { TargetType = (DCompileTarget)Enum.Parse(typeof(DCompileTarget), x.ReadContentAsString()); } while (x.Read()) { switch (x.LocalName) { case "CompilerCommand": Compiler = x.ReadString(); break; case "LinkerCommand": Linker = x.ReadString(); break; case "ObjectLinkPattern": ObjectFileLinkPattern = x.ReadString(); break; case "IncludePathPattern": IncludePathPattern = x.ReadString(); break; case "DebugArgs": var s = x.ReadSubtree(); DebugArguments.ReadFrom(s); s.Close(); break; case "ReleaseArgs": var s2 = x.ReadSubtree(); ReleaseArguments.ReadFrom(s2); s2.Close(); break; } } }