internal static Upbring LoadXml() { try { if (!File.Exists(UpbringPath)) { Upbring newUpbring = new Upbring { InstalledPackage = new InstalledPackage[0] }; return(newUpbring); } // No StrictXmlDeserialization for Upbring due to xsi attributes not being recognized // for now, disabled, as we believe we generated properly // StrictXmlDeserializer<Upbring> deserializer = new StrictXmlDeserializer<Upbring>(); XmlSerializer serializer = new XmlSerializer(typeof(Upbring)); using (FileStream fs = new FileStream(UpbringPath, FileMode.Open)) { return(serializer.Deserialize(fs) as Upbring); } } catch (Exception e) { throw new ApplicationException("Uplift: Could not load Upbring", e); } }
internal static Upbring LoadXml() { if (!File.Exists(UpbringPath)) { Upbring newUpbring = new Upbring { InstalledPackage = new InstalledPackage[0] }; return(newUpbring); } XmlSerializer serializer = new XmlSerializer(typeof(Upbring)); using (FileStream fs = new FileStream(UpbringPath, FileMode.Open)) { return(serializer.Deserialize(fs) as Upbring); } }
internal static void InitializeInstance() { instance = LoadXml(); }
public static void ResetInstance() { instance = null; InitializeInstance(); }