private static bool CheckVersion(HyvesApplication hyvesApplication) { if (hyvesApplication.Version == null || hyvesApplication.Version != getVersion()) { return false; } return true; }
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); } }
public static HyvesApplication GetInstance() { lock (_lock) { if (hyvesApplication == null) { hyvesApplication = new HyvesApplication(); } } return hyvesApplication; }
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; }