Ejemplo n.º 1
0
        public static void Save(string massmsgFilePath, MassMsgStorage storage)
        {
            FileStream fs = new FileStream(massmsgFilePath, FileMode.Create);

            // Construct a SoapFormatter and use it
            // to serialize the data to the stream.
            BinaryFormatter formatter = new BinaryFormatter();
            try
            {
                storage.Conserve();
                formatter.Serialize(fs, storage);
            }
            catch (SerializationException e)
            {
                throw;
            }
            finally
            {
                fs.Close();
            }
        }
Ejemplo n.º 2
0
 internal static void Load(string massmsgFilePath, ref MassMsgStorage massMsg)
 {
     using (FileStream fs = new FileStream(massmsgFilePath, FileMode.OpenOrCreate))
     {
         BinaryFormatter formatter = new BinaryFormatter();
         try
         {
             massMsg = (MassMsgStorage)formatter.Deserialize(fs);
         }
         catch (SerializationException e)
         {
             throw;
         }
         finally
         {
             fs.Close();
         }
     }
 }
Ejemplo n.º 3
0
        private void ResetAll()
        {
            CloseDocument();

            docView.VirtualListSize = 0;
            docView.Columns.Clear();
            ///
            logSB = new StringBuilder();

            mainProgressBar.Value = 0;
            massMsg = new MassMsgStorage();
            msm = new MySqlKannelManager();
            massMsg.TranslitEnabled = smsSetts.NeedTransliteration;
            //massMsg.progressChanged += new ChangeProgress(ProgressChangedEventHandler);
            //massMsg.reportAdded+=new ReportTransl(addStringToLog);

            docView.ClearCache();
            UpdateWinCap();
        }