static UserActivityManger()
 {
     if(File.Exists("history.bin"))
     {
         using (FileStream historyStream = new FileStream("history.bin", FileMode.Open, FileAccess.Read, FileShare.Read))
         {
             IFormatter historyFormater = new BinaryFormatter();
             History = (UserActivityHistory)historyFormater.Deserialize(historyStream);
         }
     }
     else
     {
         History = new UserActivityHistory();
     }
 }
Esempio n. 2
0
 static UserActivityManger()
 {
     if (File.Exists("history.bin"))
     {
         using (FileStream historyStream = new FileStream("history.bin", FileMode.Open, FileAccess.Read, FileShare.Read))
         {
             IFormatter historyFormater = new BinaryFormatter();
             History = (UserActivityHistory)historyFormater.Deserialize(historyStream);
         }
     }
     else
     {
         History = new UserActivityHistory();
     }
 }