public DiscussionClosed(Tenant tenantId, ForumId forumId, DiscussionId discussionId, string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.DiscussionId = discussionId; this.ExclusiveOwner = exclusiveOwner; }
public CalendarDescriptionChanged(Tenant tenant, CalendarId calendarId, string name, string description) { this.Tenant = tenant; this.CalendarId = calendarId; this.Name = name; this.Description = description; }
public CalendarShared(Tenant tenant, CalendarId calendarId, string name, CalendarSharer sharedWith) { this.Tenant = tenant; this.CalendarId = calendarId; this.Name = name; this.SharedWith = sharedWith; }
public ForumSubjectChanged(Tenant tenantId, ForumId forumId, string subject, string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.Subject = subject; this.ExclusiveOwner = exclusiveOwner; }
public CalendarEntry( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, string description, string location, Owner owner, DateRange timeSpan, Repetition repetition, Alarm alarm, IEnumerable<Participant> invitees = null) { AssertionConcern.AssertArgumentNotNull(tenant, "The tenant must be provided."); AssertionConcern.AssertArgumentNotNull(calendarId, "The calendar id must be provided."); AssertionConcern.AssertArgumentNotNull(calendarEntryId, "The calendar entry id must be provided."); AssertionConcern.AssertArgumentNotEmpty(description, "The description must be provided."); AssertionConcern.AssertArgumentNotEmpty(location, "The location must be provided."); AssertionConcern.AssertArgumentNotNull(owner, "The owner must be provided."); AssertionConcern.AssertArgumentNotNull(timeSpan, "The time span must be provided."); AssertionConcern.AssertArgumentNotNull(repetition, "The repetition must be provided."); AssertionConcern.AssertArgumentNotNull(alarm, "The alarm must be provided."); if (repetition.Repeats == RepeatType.DoesNotRepeat) repetition = Repetition.DoesNotRepeat(timeSpan.Ends); AssertTimeSpans(repetition, timeSpan); Apply(new CalendarEntryScheduled(tenant, calendarId, calendarEntryId, description, location, owner, timeSpan, repetition, alarm, invitees)); }
public ForumModeratorChanged(Tenant tenantId, ForumId forumId, Moderator moderator,string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.Moderator = moderator; this.ExclusiveOwner = exclusiveOwner; }
public ForumDescriptionChanged(Tenant tenantId, ForumId forumId, string description, string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.Description = description; this.ExclusiveOwner = exclusiveOwner; }
public Calendar(Tenant tenant, CalendarId calendarId, string name, string description, Owner owner, IEnumerable<CalendarSharer> sharedWith = null) { AssertionConcern.AssertArgumentNotNull(tenant, "The tenant must be provided."); AssertionConcern.AssertArgumentNotNull(calendarId, "The calendar id must be provided."); AssertionConcern.AssertArgumentNotEmpty(name, "The name must be provided."); AssertionConcern.AssertArgumentNotEmpty(description, "The description must be provided."); AssertionConcern.AssertArgumentNotNull(owner, "The owner must be provided."); Apply(new CalendarCreated(tenant, calendarId, name, description, owner, sharedWith)); }
public PostedContentAltered(Tenant tenantId, ForumId forumId, DiscussionId discussionId, PostId postId, string subject, string bodyText) { this.TenantId = tenantId; this.ForumId = forumId; this.DiscussionId = discussionId; this.PostId = postId; this.Subject = subject; this.BodyText = bodyText; }
public DiscussionStarted(Tenant tenantId, ForumId forumId, DiscussionId discussionId, Author author, string subject, string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.DiscussionId = discussionId; this.Author = author; this.Subject = subject; this.ExclusiveOwner = exclusiveOwner; }
public CalendarCreated(Tenant tenant, CalendarId calendarId, string name, string description, Owner owner, IEnumerable<CalendarSharer> sharedWith) { this.Tenant = tenant; this.CalendarId = calendarId; this.Name = name; this.Description = description; this.Owner = owner; this.SharedWith = sharedWith; }
public Discussion(Tenant tenantId, ForumId forumId, DiscussionId discussionId, Author author, string subject, string exclusiveOwner = null) { AssertionConcern.AssertArgumentNotNull(tenantId, "The tenant must be provided."); AssertionConcern.AssertArgumentNotNull(forumId, "The forum id must be provided."); AssertionConcern.AssertArgumentNotNull(discussionId, "The discussion id must be provided."); AssertionConcern.AssertArgumentNotNull(author, "The author must be provided."); AssertionConcern.AssertArgumentNotEmpty(subject, "The subject must be provided."); Apply(new DiscussionStarted(tenantId, forumId, discussionId, author, subject, exclusiveOwner)); }
public ForumStarted(Tenant tenantId, ForumId forumId, Creator creator, Moderator moderator, string subject, string description, string exclusiveOwner) { this.TenantId = tenantId; this.ForumId = forumId; this.Creator = creator; this.Moderator = moderator; this.Subject = subject; this.Description = description; this.ExclusiveOwner = exclusiveOwner; }
ISet<Participant> GetInviteesFrom(Tenant tenant, ISet<string> participantsToInvite) { var invitees = new HashSet<Participant>(); foreach (string participatnId in participantsToInvite) { var participant = this.collaboratorService.GetParticipantFrom(tenant, participatnId); invitees.Add(participant); } return invitees; }
void When(PostedToDiscussion e) { this.tenantId = e.TenantId; this.forumId = e.ForumId; this.discussionId = e.DiscussionId; this.postId = e.PostId; this.author = e.Author; this.subject = e.Subject; this.bodyText = e.BodyText; this.replyToPostId = e.ReplyToPostId; }
public Post(Tenant tenantId, ForumId forumId, DiscussionId discussionId, PostId postId, Author author, string subject, string bodyText, PostId replyToPostId = null) { AssertionConcern.AssertArgumentNotNull(tenantId, "The tenant must be provided."); AssertionConcern.AssertArgumentNotNull(forumId, "The forum id must be provided."); AssertionConcern.AssertArgumentNotNull(discussionId, "The discussion id must be provided."); AssertionConcern.AssertArgumentNotNull(postId, "The post id must be provided."); AssertionConcern.AssertArgumentNotNull(author, "The author must be provided."); AssertPostContent(subject, bodyText); Apply(new PostedToDiscussion(tenantId, forumId, discussionId, postId, author, subject, bodyText, replyToPostId)); }
public CalendarEntryRelocated( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, string location) { this.Tenant = tenant; this.CalendarId = calendarId; this.CalendarEntryId = calendarEntryId; this.Location = location; }
public CalendarEntryDescriptionChanged( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, string description) { this.Tenant = tenant; this.CalendarId = calendarId; this.CalendarEntryId = calendarEntryId; this.Description = description; }
public Forum(Tenant tenantId, ForumId forumId, Creator creator, Moderator moderator, string subject, string description, string exclusiveOwner) { AssertionConcern.AssertArgumentNotNull(tenantId, "The tenant must be provided."); AssertionConcern.AssertArgumentNotNull(forumId, "The forum id must be provided."); AssertionConcern.AssertArgumentNotNull(creator, "The creator must be provided."); AssertionConcern.AssertArgumentNotNull(moderator, "The moderator must be provided."); AssertionConcern.AssertArgumentNotEmpty(subject, "The subject must be provided."); AssertionConcern.AssertArgumentNotEmpty(description, "The description must be provided."); Apply(new ForumStarted(tenantId, forumId, creator, moderator, subject, description, exclusiveOwner)); }
public PostedToDiscussion(Tenant tenantId, ForumId forumId, DiscussionId discussionId, PostId postId, Author author, string subject, string bodyText, PostId replyToPostId) { this.TenantId = tenantId; this.ForumId = forumId; this.DiscussionId = discussionId; this.PostId = postId; this.Author = author; this.Subject = subject; this.BodyText = bodyText; this.ReplyToPostId = replyToPostId; }
public CalendarEntryParticipantUninvited( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, Participant participant) { this.Tenant = tenant; this.CalendarId = calendarId; this.CalendarEntryId = calendarEntryId; this.Participant = participant; }
public void ShareCalendarWith(string tenantId, string calendarId, ISet<string> participantsToShareWith) { var tenant = new Tenant(tenantId); var calendar = this.calendarRepository.Get(tenant, new CalendarId(calendarId)); foreach (var sharer in GetSharersFrom(tenant, participantsToShareWith)) { calendar.ShareCalendarWith(sharer); } this.calendarRepository.Save(calendar); }
public void UninviteCalendarEntryParticipant(string tenantId, string calendarEntryId, ISet<string> participantsToUninvite) { var tenant = new Tenant(tenantId); var calendarEntry = this.calendarEntryRepository.Get(tenant, new CalendarEntryId(calendarEntryId)); foreach (var participant in GetInviteesFrom(tenant, participantsToUninvite)) { calendarEntry.Uninvite(participant); } this.calendarEntryRepository.Save(calendarEntry); }
public void CreateCalendar(string tenantId, string name, string description, string ownerId, ISet<string> participantsToShareWith, ICalendarCommandResult calendarCommandResult) { var tenant = new Tenant(tenantId); var owner = this.collaboratorService.GetOwnerFrom(tenant, ownerId); var sharers = GetSharersFrom(tenant, participantsToShareWith); var calendar = new Calendar(tenant, this.calendarRepository.GetNextIdentity(), name, description, owner, sharers); this.calendarRepository.Save(calendar); calendarCommandResult.SetResultingCalendarId(calendar.CalendarId.Id); }
public void AssignModeratorToForum(string tenantId, string forumId, string moderatorId) { var tenant = new Tenant(tenantId); var forum = this.forumRepository.Get(tenant, new ForumId(forumId)); var moderator = this.collaboratorService.GetModeratorFrom(tenant, moderatorId); forum.AssignModerator(moderator); this.forumRepository.Save(forum); }
void When(CalendarEntryScheduled e) { this.tenant = e.Tenant; this.calendarId = e.CalendarId; this.calendarEntryId = e.CalendarEntryId; this.description = e.Description; this.location = e.Location; this.owner = e.Owner; this.timeSpan = e.TimeSpan; this.repetition = e.Repetition; this.alarm = e.Alarm; this.invitees = new HashSet<Participant>(e.Invitees ?? Enumerable.Empty<Participant>()); }
public CalendarEntryRescheduled( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, DateRange timeSpan, Repetition repetition, Alarm alarm) { this.Tenant = tenant; this.CalendarId = calendarId; this.CalendarEntryId = calendarEntryId; this.TimeSpan = timeSpan; this.Repetition = repetition; this.Alarm = alarm; }
public void ModeratePost( string tenantId, string forumId, string postId, string moderatorId, string subject, string bodyText) { var tenant = new Tenant(tenantId); var forum = this.forumRepository.Get(tenant, new ForumId(forumId)); var moderator = this.collaboratorService.GetModeratorFrom(tenant, moderatorId); var post = this.postRepository.Get(tenant, new PostId(postId)); forum.ModeratePost(post, moderator, subject, bodyText); this.postRepository.Save(post); }
public void ScheduleCalendarEntry(string tenantId, string calendarId, string description, string location, string ownerId, DateTime timeSpanBegins, DateTime timeSpanEnds, string repeatType, DateTime repeatEndsOn, string alarmType, int alarmUnits, ISet<string> participantsToInvite, ICalendarCommandResult calendarCommandResult) { var tenant = new Tenant(tenantId); var calendar = this.calendarRepository.Get(tenant, new CalendarId(calendarId)); var calendarEntry = calendar.ScheduleCalendarEntry( this.calendarIdentityService, description, location, this.collaboratorService.GetOwnerFrom(tenant, ownerId), new DateRange(timeSpanBegins, timeSpanEnds), new Repetition((RepeatType)Enum.Parse(typeof(RepeatType), repeatType), repeatEndsOn), new Alarm((AlarmUnitsType)Enum.Parse(typeof(AlarmUnitsType), alarmType), alarmUnits), GetInviteesFrom(tenant, participantsToInvite)); this.calendarEntryRepository.Save(calendarEntry); calendarCommandResult.SetResultingCalendarId(calendar.CalendarId.Id); calendarCommandResult.SetResultingCalendarEntryId(calendarEntry.CalendarEntryId.Id); }
public CalendarEntryScheduled( Tenant tenant, CalendarId calendarId, CalendarEntryId calendarEntryId, string description, string location, Owner owner, DateRange timeSpan, Repetition repetition, Alarm alarm, IEnumerable<Participant> invitees) { this.Tenant = tenant; this.CalendarId = calendarId; this.CalendarEntryId = calendarEntryId; this.Description = description; this.Location = location; this.Owner = owner; this.TimeSpan = timeSpan; this.Repetition = repetition; this.Alarm = alarm; this.Invitees = invitees; }