예제 #1
0
파일: Upbring.cs 프로젝트: sjb8100/uplift
 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);
     }
 }
예제 #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);
            }
        }
예제 #3
0
파일: Upbring.cs 프로젝트: sjb8100/uplift
 internal static void InitializeInstance()
 {
     instance = LoadXml();
 }
예제 #4
0
파일: Upbring.cs 프로젝트: sjb8100/uplift
 public static void ResetInstance()
 {
     instance = null;
     InitializeInstance();
 }