File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 1- using System . IO ;
1+ using System ;
2+ using System . IO ;
23using System . Reflection ;
3- using System . Xml . Serialization ;
4+ using System . Xml . Linq ;
45
56namespace IncrementalCompiler
67{
@@ -29,14 +30,13 @@ public static Settings Load()
2930
3031 public static Settings Load ( Stream stream )
3132 {
32- var deserializer = new XmlSerializer ( typeof ( Settings ) ) ;
33- return ( Settings ) deserializer . Deserialize ( stream ) ;
34- }
35-
36- public static void Save ( Stream stream , Settings settings )
37- {
38- var serializer = new XmlSerializer ( typeof ( Settings ) ) ;
39- serializer . Serialize ( stream , settings ) ;
33+ // To reduce start-up time, do manual parsing instead of using XmlSerializer
34+ var xdoc = XDocument . Load ( stream ) . Element ( "Settings" ) ;
35+ return new Settings
36+ {
37+ DebugSymbolFile = ( DebugSymbolFileType ) Enum . Parse ( typeof ( DebugSymbolFileType ) , xdoc . Element ( "DebugSymbolFile" ) . Value ) ,
38+ PrebuiltOutputReuse = ( PrebuiltOutputReuseType ) Enum . Parse ( typeof ( PrebuiltOutputReuseType ) , xdoc . Element ( "PrebuiltOutputReuse" ) . Value ) ,
39+ } ;
4040 }
4141 }
4242}
You can’t perform that action at this time.
0 commit comments