internal static void Serialize(JiraConnectionSettings appSettings) { if (!Directory.Exists(FilePathSettings.DataSavePath)) { Directory.CreateDirectory(FilePathSettings.DataSavePath); } File.WriteAllText(SavePath, DataEncryption.Encrypt(JsonConvert.SerializeObject(appSettings))); }
public Backend() { appSettings = AppSettingsSerializer.DeSerialize(); jiraConnectionSettings = JiraConnectionSettingsSerializer.DeSerialize(); jiraTimerCollection = new JiraTimerCollection(); idleTimerCollection = new IdleTimerCollection(); ActivityChecker = new ActivityChecker(jiraTimerCollection, appSettings); ActivityChecker.NoActivityEvent += OnNoActivityEvent; hearbeat = new Timer(3600000); hearbeat.Elapsed += HearbeatOnElapsed; hearbeat.Start(); }
internal static JiraConnectionSettings DeSerialize() { JiraConnectionSettings jiraConnectionSettings; if (File.Exists(SavePath)) { try { var text = DataEncryption.Decrypt(File.ReadAllText(SavePath)); jiraConnectionSettings = JsonConvert.DeserializeObject <JiraConnectionSettings>(text); } catch (Exception) { jiraConnectionSettings = new JiraConnectionSettings(); } } else { jiraConnectionSettings = new JiraConnectionSettings(); } return(jiraConnectionSettings); }
public void ReConnect(JiraConnectionSettings newJiraConnectionSettings) { jiraConnectionSettings = newJiraConnectionSettings; jira = null; CheckAndConnectJira(); }
public JiraConnection(JiraConnectionSettings jiraConnectionSettings) { this.jiraConnectionSettings = jiraConnectionSettings; CheckAndConnectJira(); }