public static UploadOriginPhotosToStationManager Load()
        {
            try
            {
                string _json     = string.Empty;
                string _filePath = Main.GCONST.CachePath + Main.Current.RT.Login.user.user_id + "_UO.dat";

                StreamReader _sr = File.OpenText(_filePath);
                _json = _sr.ReadToEnd();
                _sr.Close();

                if (!GCONST.DEBUG)
                {
                    _json = StringUtility.Decompress(_json);
                }

                UploadOriginPhotosToStationManager _npm = JsonConvert.DeserializeObject <UploadOriginPhotosToStationManager>(_json);

                s_logger.Trace("Load:OK");

                return(_npm);
            }
            catch (Exception _e)
            {
                NLogUtility.Exception(s_logger, _e, "Load");
            }

            return(null);
        }
Exemple #2
0
        private void StartBgThreads()
        {
            UploadOriginPhotosToStationManager.Start();
            PhotoDownloader.Start();
            NewPostManager.Start();

            StationState.ShowStationState += StationState_ShowStationState;
            StationState.Start();
        }
Exemple #3
0
        public void Logout()
        {
            Program.ShowCrashReporter = false;

            QuitOption = QuitOption.Logout;

            try
            {
                if (NewPostManager != null)
                {
                    NewPostManager.AbortThread();
                    NewPostManager = null;
                }

                if (PhotoDownloader != null)
                {
                    PhotoDownloader.AbortThread();
                    PhotoDownloader = null;
                }

                if (UploadOriginPhotosToStationManager != null)
                {
                    UploadOriginPhotosToStationManager.AbortThread();
                    UploadOriginPhotosToStationManager = null;
                }

                if (StationState != null)
                {
                    StationState.AbortThread();
                    statusStrip = null;
                }
            }
            catch
            {
            }

            Close();
        }