public static SprintUser SprintGebruiker(User gebruiker, Sprint sprint, SprintRole sprintRol) { SprintUser sprintGebruiker = new SprintUser(gebruiker, sprint, sprintRol); Project project = Project(); project.AddSprint(sprint); return Persist(sprintGebruiker); }
/// <summary> /// Initializes a new instance of the <see cref="SprintUser"/> class for the given user, sprint and role. /// </summary> /// <param name="user">The user.</param> /// <param name="sprint">The sprint.</param> /// <param name="role">The role.</param> public SprintUser(User user, Sprint sprint, SprintRole role) { if (user == null) throw new ArgumentNullException("user", "The user can not be null."); if (sprint == null) throw new ArgumentNullException("sprint", "The sprint can not be null."); user.AddSprintUser(this); sprint.AddSprintUser(this); this.sprintRole = role; }
/// <summary> /// Removes the given role from the current set of roles. /// </summary> /// <param name="role">The role.</param> public virtual void RemoveRole(SprintRole role) { sprintRole &= ~role; }
/// <summary> /// Determines if this sprintuser has the given sprintrole /// </summary> /// <param name="role">The role.</param> /// <returns></returns> public virtual bool HasSprintRole(SprintRole role) { return ((sprintRole & role) != 0); }
/// <summary> /// Determines if this sprintuser has EXACTLY the same sprintrole as the given role /// </summary> /// <param name="role">The role.</param> /// <returns></returns> public virtual bool HasExactlyThisSprintRole(SprintRole role) { return (sprintRole == role); }
/// <summary> /// Adds the given sprintrole to the current set of sprintroles. /// </summary> /// <param name="role">The role.</param> public virtual void AddRole(SprintRole role) { this.sprintRole |= role; }