Пример #1
0
        private void ReadSettings()
        {
            this.JiraBaseUrl = Properties.Settings.Default.JiraBaseUrl ?? "";

            this.AlwaysOnTop        = Properties.Settings.Default.AlwaysOnTop;
            this.IncludeProjectName = Properties.Settings.Default.IncludeProjectName;
            this.MinimizeToTray     = Properties.Settings.Default.MinimizeToTray;
            this.IssueCount         = Properties.Settings.Default.IssueCount;
            this.Username           = Properties.Settings.Default.Username;
            if (Properties.Settings.Default.ApiToken != "")
            {
                this.ApiToken = DPAPI.Decrypt(Properties.Settings.Default.ApiToken);
            }
            else
            {
                this.ApiToken = "";
            }
            this.FirstRun           = Properties.Settings.Default.FirstRun;
            this.SaveTimerState     = (SaveTimerSetting)Properties.Settings.Default.SaveTimerState;
            this.PauseOnSessionLock = (PauseAndResumeSetting)Properties.Settings.Default.PauseOnSessionLock;
            this.PostWorklogComment = (WorklogCommentSetting)Properties.Settings.Default.PostWorklogComment;

            this.CurrentFilter = Properties.Settings.Default.CurrentFilter;

            this.PersistedIssues = ReadIssues(Properties.Settings.Default.PersistedIssues);

            this.AllowMultipleTimers = Properties.Settings.Default.AllowMultipleTimers;

            this.StartTransitions = Properties.Settings.Default.StartTransitions;

            this.LoggingEnabled = Properties.Settings.Default.LoggingEnabled;

            CheckForUpdate = Properties.Settings.Default.CheckForUpdate;
        }
Пример #2
0
        public void Load()
        {
            this.JiraBaseUrl = Properties.Settings.Default.JiraBaseUrl ?? "";

            this.TimerEditable  = Properties.Settings.Default.TimerEditable;
            this.AlwaysOnTop    = Properties.Settings.Default.AlwaysOnTop;
            this.MinimizeToTray = Properties.Settings.Default.MinimizeToTray;
            this.IssueCount     = Properties.Settings.Default.IssueCount;
            this.Username       = Properties.Settings.Default.Username;
            if (Properties.Settings.Default.Password != "")
            {
                this.Password = DPAPI.Decrypt(Properties.Settings.Default.Password);
            }
            else
            {
                this.Password = "";
            }
            this.RememberCredentials = Properties.Settings.Default.RememberCredentials;
            this.FirstRun            = Properties.Settings.Default.FirstRun;
            this.SaveTimerState      = (SaveTimerSetting)Properties.Settings.Default.SaveTimerState;
            this.PauseOnSessionLock  = (PauseAndResumeSetting)Properties.Settings.Default.PauseOnSessionLock;

            this.CurrentFilter = Properties.Settings.Default.CurrentFilter;

            this.PersistedIssues = ReadIssues(Properties.Settings.Default.PersistedIssues);

            this.AllowMultipleTimers = Properties.Settings.Default.AllowMultipleTimers;
        }
Пример #3
0
        public void Save()
        {
            Properties.Settings.Default.JiraBaseUrl = this.JiraBaseUrl;

            Properties.Settings.Default.TimerEditable    = this.TimerEditable;
            Properties.Settings.Default.AlwaysOnTop      = this.AlwaysOnTop;
            Properties.Settings.Default.MinimizeToTray   = this.MinimizeToTray;
            Properties.Settings.Default.PauseActiveTimer = this.PauseActiveTimer;
            Properties.Settings.Default.IssueCount       = this.IssueCount;
            Properties.Settings.Default.Username         = this.Username;
            if (this.Password != "")
            {
                Properties.Settings.Default.Password = DPAPI.Encrypt(this.Password);
            }
            else
            {
                Properties.Settings.Default.Password = "";
            }
            Properties.Settings.Default.RememberCredentials = this.RememberCredentials;
            Properties.Settings.Default.FirstRun            = this.FirstRun;
            Properties.Settings.Default.SaveTimerState      = (int)this.SaveTimerState;

            Properties.Settings.Default.CurrentFilter = this.CurrentFilter;

            Properties.Settings.Default.PersistedIssues = WriteIssues(this.PersistedIssues);

            Properties.Settings.Default.Save();
        }
Пример #4
0
        public void Save()
        {
            lock (_writeLock)
            {
                Properties.Settings.Default.JiraBaseUrl = this.JiraBaseUrl;

                Properties.Settings.Default.AlwaysOnTop        = this.AlwaysOnTop;
                Properties.Settings.Default.MinimizeToTray     = this.MinimizeToTray;
                Properties.Settings.Default.IssueCount         = this.IssueCount;
                Properties.Settings.Default.IncludeProjectName = this.IncludeProjectName;

                Properties.Settings.Default.Username = this.Username;
                if (this.Password != "")
                {
                    Properties.Settings.Default.Password = DPAPI.Encrypt(this.Password);
                }
                else
                {
                    Properties.Settings.Default.Password = "";
                }

                Properties.Settings.Default.FirstRun           = this.FirstRun;
                Properties.Settings.Default.SaveTimerState     = (int)this.SaveTimerState;
                Properties.Settings.Default.PauseOnSessionLock = (int)this.PauseOnSessionLock;
                Properties.Settings.Default.PostWorklogComment = (int)this.PostWorklogComment;

                Properties.Settings.Default.CurrentFilter = this.CurrentFilter;

                Properties.Settings.Default.PersistedIssues = WriteIssues(this.PersistedIssues);

                Properties.Settings.Default.AllowMultipleTimers = this.AllowMultipleTimers;

                Properties.Settings.Default.StartTransitions = this.StartTransitions;

                Properties.Settings.Default.LoggingEnabled = this.LoggingEnabled;

                Properties.Settings.Default.CheckForUpdate = CheckForUpdate;

                Properties.Settings.Default.ComPort = this.SelectedComPort;

                Properties.Settings.Default.TcpPort = this.SelectedTcpPort;

                Properties.Settings.Default.Save();
            }
        }
Пример #5
0
        private void ReadSettings()
        {
            this.JiraBaseUrl = Properties.Settings.Default.JiraBaseUrl ?? "";

            this.AlwaysOnTop        = Properties.Settings.Default.AlwaysOnTop;
            this.IncludeProjectName = Properties.Settings.Default.IncludeProjectName;
            this.MinimizeToTray     = Properties.Settings.Default.MinimizeToTray;
            this.IssueCount         = Properties.Settings.Default.IssueCount;
            this.Username           = Properties.Settings.Default.Username;
            if (Properties.Settings.Default.Password != "")
            {
                this.Password = DPAPI.Decrypt(Properties.Settings.Default.Password);
            }
            else
            {
                this.Password = "";
            }
            this.FirstRun           = Properties.Settings.Default.FirstRun;
            this.SaveTimerState     = (SaveTimerSetting)Properties.Settings.Default.SaveTimerState;
            this.PauseOnSessionLock = (PauseAndResumeSetting)Properties.Settings.Default.PauseOnSessionLock;
            this.PostWorklogComment = (WorklogCommentSetting)Properties.Settings.Default.PostWorklogComment;

            this.CurrentFilter = Properties.Settings.Default.CurrentFilter;

            this.PersistedIssues = ReadIssues(Properties.Settings.Default.PersistedIssues);

            if (!string.IsNullOrEmpty(Properties.Settings.Default.TotalTimeLogged) &&
                DateTime.Now.ToString("d") == Properties.Settings.Default.WorkingDate)
            {
                this.TotalTimeLogged = TimeSpan.Parse(Properties.Settings.Default.TotalTimeLogged);
            }

            this.AllowMultipleTimers = Properties.Settings.Default.AllowMultipleTimers;

            this.StartTransitions = Properties.Settings.Default.StartTransitions;

            this.LoggingEnabled = Properties.Settings.Default.LoggingEnabled;

            CheckForUpdate = Properties.Settings.Default.CheckForUpdate;
        }
Пример #6
0
        public void Save()
        {
            Properties.Settings.Default.JiraBaseUrl = this.JiraBaseUrl;

            Properties.Settings.Default.AlwaysOnTop    = this.AlwaysOnTop;
            Properties.Settings.Default.MinimizeToTray = this.MinimizeToTray;
            Properties.Settings.Default.IssueCount     = this.IssueCount;

            Properties.Settings.Default.RememberCredentials = this.RememberCredentials;
            if (this.RememberCredentials)
            {
                Properties.Settings.Default.Username = this.Username;
                if (this.Password != "")
                {
                    Properties.Settings.Default.Password = DPAPI.Encrypt(this.Password);
                }
                else
                {
                    Properties.Settings.Default.Password = "";
                }
            }
            else
            {
                Properties.Settings.Default.Username = "";
                Properties.Settings.Default.Password = "";
            }

            Properties.Settings.Default.FirstRun           = this.FirstRun;
            Properties.Settings.Default.SaveTimerState     = (int)this.SaveTimerState;
            Properties.Settings.Default.PauseOnSessionLock = (int)this.PauseOnSessionLock;
            Properties.Settings.Default.PostWorklogComment = (int)this.PostWorklogComment;

            Properties.Settings.Default.CurrentFilter = this.CurrentFilter;

            Properties.Settings.Default.PersistedIssues = WriteIssues(this.PersistedIssues);

            Properties.Settings.Default.AllowMultipleTimers = this.AllowMultipleTimers;

            Properties.Settings.Default.Save();
        }
Пример #7
0
        public void Save()
        {
            lock (_writeLock)
            {
                Properties.Settings.Default.JiraBaseUrl = this.JiraBaseUrl;

                Properties.Settings.Default.AlwaysOnTop        = this.AlwaysOnTop;
                Properties.Settings.Default.MinimizeToTray     = this.MinimizeToTray;
                Properties.Settings.Default.IssueCounts        = WriteIssueCounts(this.IssueCounts);
                Properties.Settings.Default.TabNames           = WriteTabNames(this.TabNames);
                Properties.Settings.Default.IncludeProjectName = this.IncludeProjectName;

                Properties.Settings.Default.Username        = this.Username;
                Properties.Settings.Default.PrivateApiToken = this.PrivateApiToken != "" ? DPAPI.Encrypt(this.PrivateApiToken) : "";

                Properties.Settings.Default.FirstRun           = this.FirstRun;
                Properties.Settings.Default.SaveTimerState     = (int)this.SaveTimerState;
                Properties.Settings.Default.PauseOnSessionLock = (int)this.PauseOnSessionLock;
                Properties.Settings.Default.PostWorklogComment = (int)this.PostWorklogComment;

                Properties.Settings.Default.CurrentFilter = this.CurrentFilter;

                Properties.Settings.Default.PersistedIssues = WriteIssues(this.PersistedIssues);

                Properties.Settings.Default.TotalTimeLogged = this.TotalTimeLogged.ToString();

                Properties.Settings.Default.WorkingDate = DateTime.Now.ToString("d");

                Properties.Settings.Default.AllowMultipleTimers = this.AllowMultipleTimers;

                Properties.Settings.Default.StartTransitions = this.StartTransitions;

                Properties.Settings.Default.LoggingEnabled = this.LoggingEnabled;

                Properties.Settings.Default.JiraAvatarUrl = this.JiraAvatarUrl;

                Properties.Settings.Default.CheckForUpdate = CheckForUpdate;

                Properties.Settings.Default.Save();
            }
        }
Пример #8
0
        private void ReadSettings()
        {
            this.JiraBaseUrl = Properties.Settings.Default.JiraBaseUrl ?? "";

            this.AlwaysOnTop        = Properties.Settings.Default.AlwaysOnTop;
            this.IncludeProjectName = Properties.Settings.Default.IncludeProjectName;
            this.MinimizeToTray     = Properties.Settings.Default.MinimizeToTray;
            this.IssueCounts        = ReadIssueCounts(Properties.Settings.Default.IssueCounts);
            this.TabNames           = ReadTabNames(Properties.Settings.Default.TabNames);
            this.Username           = Properties.Settings.Default.Username;
            this.PrivateApiToken    = Properties.Settings.Default.PrivateApiToken != "" ? DPAPI.Decrypt(Properties.Settings.Default.PrivateApiToken) : "";
            this.FirstRun           = Properties.Settings.Default.FirstRun;
            this.SaveTimerState     = (SaveTimerSetting)Properties.Settings.Default.SaveTimerState;
            this.PauseOnSessionLock = (PauseAndResumeSetting)Properties.Settings.Default.PauseOnSessionLock;
            this.PostWorklogComment = (WorklogCommentSetting)Properties.Settings.Default.PostWorklogComment;

            this.CurrentFilter = Properties.Settings.Default.CurrentFilter;

            this.PersistedIssues = ReadIssues(Properties.Settings.Default.PersistedIssues);

            if (this.IssueCounts == null || this.IssueCounts.Count == 0)
            {
                int count = this.PersistedIssues.Count > 0 ? this.PersistedIssues[0].Count : 0;
                if (count <= 0)
                {
                    count = 6;
                }
                this.IssueCounts = new Dictionary <int, int> {
                    { 0, count }
                };
            }
            if (this.TabNames == null)
            {
                this.TabNames = new Dictionary <int, string>();
                foreach (var count in IssueCounts)
                {
                    this.TabNames.Add(count.Key, $"Tab {count.Key}");
                }
            }

            if (!string.IsNullOrEmpty(Properties.Settings.Default.TotalTimeLogged) &&
                DateTime.Now.ToString("d") == Properties.Settings.Default.WorkingDate)
            {
                this.TotalTimeLogged = TimeSpan.Parse(Properties.Settings.Default.TotalTimeLogged);
            }

            this.AllowMultipleTimers = Properties.Settings.Default.AllowMultipleTimers;

            this.StartTransitions = Properties.Settings.Default.StartTransitions;

            this.LoggingEnabled = Properties.Settings.Default.LoggingEnabled;

            this.JiraAvatarUrl = Properties.Settings.Default.JiraAvatarUrl;

            CheckForUpdate = Properties.Settings.Default.CheckForUpdate;
        }