private void selectDefaultProjectFromSettings() { var projectID = Toggl.GetDefaultProjectId(); var taskID = Toggl.GetDefaultTaskId(); var project = default(Toggl.TogglAutocompleteView); if (this.knownProjects != null) { project = this.knownProjects .FirstOrDefault(p => p.ProjectID == projectID && p.TaskID == taskID); } if (project.ProjectID != projectID || project.TaskID != taskID) { project = new Toggl.TogglAutocompleteView { ProjectLabel = Toggl.GetDefaultProjectName(), ProjectID = projectID, TaskID = taskID, }; } this.selectDefaultProject(project); }