Example #1
0
 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);
     }
 }
Example #2
0
        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);
            }
        }
Example #3
0
 internal static void InitializeInstance()
 {
     instance = LoadXml();
 }
Example #4
0
 public static void ResetInstance()
 {
     instance = null;
     InitializeInstance();
 }