コード例 #1
0
        public void Get(string paramOne)
        {
            if (paramOne.ToLower() == "reset")
            {
                Log.Append("GET - Reset Email Sync Parameters");
                Global.isSyncing = false;
                Readiness.DeleteBlockerFile();
            }

            //if (!Permissions.ValidAPIKey(APIKey)) return new Email[] {};
            paramOne = AESGCM.SimpleDecryptWithPassword(paramOne.Replace("_", "/").Replace("-", "+"), AESGCM.AES256Key);

            if (paramOne.ToLower() == "sync")
            {
                Log.Append("GET - Sync PST Files");
                PSTImporter.SyncPSTFiles();
            }
            if (paramOne.ToLower() == "validate")
            {
                Log.Append("GET - Validating email and file integrity");
                Task.Run(() => Global.ValidateMessages());
            }
            if (paramOne.ToLower() == "refresh")
            {
                Log.Append("GET - Refresh Email List requested");
                // Reload settings before getting emails
                Global.LoadSettings();
                EmailRepository.CacheInfo(Global.GetAllEmails().ToArray());
            }
            //return new Email[] { };
        }