Exemplo n.º 1
0
        public static bool LoadUserTableData(string filePath)
        {
            bool result = true;
            var userListsDataDeserializationResult = new ExternalUserRatingTableData();

            FileStream fs = null;
            try
            {
                fs = new FileStream(filePath, FileMode.Open);
                BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.File));
                userListsDataDeserializationResult = (ExternalUserRatingTableData)bf.Deserialize(fs);

                OverrideUserTableData(userListsDataDeserializationResult);
            }
            catch (Exception) { }
            finally
            {
                if (fs != null) fs.Close();
            }
            return result && userListsDataDeserializationResult.IsReady;
        }
Exemplo n.º 2
0
 public static void OverrideUserTableData(ExternalUserRatingTableData userListsData)
 {
     AppDomain.CurrentDomain.SetData("userListsTableData", userListsData);
 }