public bool IsValid() { return(!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Title) && !string.IsNullOrEmpty(Description) && Uri.IsWellFormedUriString(Url.ToString(), UriKind.RelativeOrAbsolute) && Uri.IsWellFormedUriString(ParentStoryUrl.ToString(), UriKind.RelativeOrAbsolute) && KeyIdentifiers != null && KeyIdentifiers.Any() ? KeyIdentifiers.All(s => s.IsValid()) : true && TestCases != null && TestCases.Any() ? TestCases.All(s => s.IsValid()) : true && Checkups != null && Checkups.Any() ? Checkups.All(s => s.IsValid()) : true && Attachments != null && Attachments.Any() ? Attachments.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true && Queries != null && Queries.Any() ? Queries.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true && Scripts != null && Scripts.Any() ? Scripts.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true && SubTasks.Any() ? SubTasks.All(s => s.IsValid()) : true); }
/// <summary> /// Update the Status of a Task when one of its Substaks changes its Status /// When a task is Semi-done, will put a minus sign on its CheckBox /// EDIT: Will use the default windows style that puts a little box in the checkbox /// </summary> private void UpdateTaskStatus() { //If at least one subtask is Done, then the task is semidone if (SubTasks.Any(task => task.Status == TaskStatus.Done) && SubTasks.Any(task => task.Status != TaskStatus.Done)) { this.Status = TaskStatus.SemiDone; } else { if (SubTasks.All(task => task.Status == TaskStatus.Done)) { this.Status = TaskStatus.Done; } ; if (SubTasks.All(task => task.Status == TaskStatus.NotDone)) { this.Status = TaskStatus.NotDone; } if (SubTasks.All(task => task.Status == TaskStatus.SemiDone)) { this.Status = TaskStatus.SemiDone; } } }