Пример #1
0
 private static bool CheckVersion(HyvesApplication hyvesApplication)
 {
     if (hyvesApplication.Version == null || hyvesApplication.Version != getVersion())
     {
         return false;
     }
     return true;
 }
Пример #2
0
 public static void Write(StorageData storageData, HyvesApplication hyvesApplication)
 {
     try
     {
         hyvesApplication.Version = getVersion();
         // Todo : add security and encryption
         IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly();
         Stream writer = new IsolatedStorageFileStream(EnumHelper.GetDescription(storageData), FileMode.Create, isf);
         IFormatter formatter = new BinaryFormatter();
         formatter.Serialize(writer, hyvesApplication);
         writer.Close();
     }
     catch (Exception ex)
     {
         //ToDo: Add logging
         //throw new ApplicationException("Write", ex);
     }
 }
Пример #3
0
 public static HyvesApplication GetInstance()
 {
     lock (_lock)
     {
         if (hyvesApplication == null)
         {
             hyvesApplication = new HyvesApplication();
         }
     }
     return hyvesApplication;
 }
Пример #4
0
 public static HyvesApplication GetInstance(HyvesApplication hyvesApplication)
 {
     lock (_lock)
     {
         if (HyvesApplication.hyvesApplication == null)
         {
             HyvesApplication.hyvesApplication = hyvesApplication;
         }
         else
         {
             throw new Exception("Hyves application is aready initialized");
         }
     }
     return HyvesApplication.hyvesApplication;
 }