public カレンダー詳細変更時(テナント tenant, カレンダーId calendarId, string name, string description)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.Name = name;
     this.Description = description;
 }
        public カレンダーエントリー(
            テナント tenant,
            カレンダーId calendarId,
            カレンダーエントリーId calendarEntryId,
            string description,
            string location,
            オーナ owner,
            データレンジ timeSpan,
            リピート repetition,
            アラーム alarm,
            IEnumerable<参加者> 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 == リピートタイプ.DoesNotRepeat)
                repetition = リピート.DoesNotRepeat(timeSpan.Ends);

            AssertTimeSpans(repetition, timeSpan);

            Apply(new カレンダーエントリースケジュール時(tenant, calendarId, calendarEntryId, description, location, owner, timeSpan, repetition, alarm, invitees));
        }
 public フォーラムタイトル変更時(テナント tenantId, フォーラムId forumId, string subject, string exclusiveOwner)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.Subject = subject;
     this.ExclusiveOwner = exclusiveOwner;
 }
 public フォーラムモデレータ変更時(テナント tenantId, フォーラムId forumId, モデレータ moderator,string exclusiveOwner)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.Moderator = moderator;
     this.ExclusiveOwner = exclusiveOwner;
 }
 public ディスカッション再開時(テナント tenantId, フォーラムId forumId, ディスカッションId discussionId, string exclusiveOwner)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.DiscussionId = discussionId;
     this.ExclusiveOwner = exclusiveOwner;
 }
 public カレンダー非共有時(テナント tenant, カレンダーId calendarId, string name, カレンダー共有 unsharedWith)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.Name = name;
     this.UnsharedWith = unsharedWith;
 }
 public ディスカッション開始時(テナント tenantId, フォーラムId forumId, ディスカッションId discussionId, 著者 author, string subject, string exclusiveOwner)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.DiscussionId = discussionId;
     this.Author = author;
     this.Subject = subject;
     this.ExclusiveOwner = exclusiveOwner;
 }
 public カレンダー作成時(テナント tenant, カレンダーId calendarId, string name, string description, オーナ owner, IEnumerable<カレンダー共有> sharedWith)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.Name = name;
     this.Description = description;
     this.Owner = owner;
     this.SharedWith = sharedWith;
 }
 public PostedContentAltered(テナント tenantId, フォーラムId forumId, ディスカッションId discussionId, ポストId postId, string subject, string bodyText)
 {
     this.TenantId = tenantId;
     this.ForumId = forumId;
     this.DiscussionId = discussionId;
     this.PostId = postId;
     this.Subject = subject;
     this.BodyText = bodyText;
 }
 public フォーラム開始時(テナント tenantId, フォーラムId forumId, クリエイタ creator, モデレータ 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;
 }
        public ディスカッション(テナント tenantId, フォーラムId forumId, ディスカッションId discussionId, 著者 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 ディスカッション開始時(tenantId, forumId, discussionId, author, subject, exclusiveOwner));
        }
 public カレンダーエントリー再配置時(
     テナント tenant,
     カレンダーId calendarId,
     カレンダーエントリーId calendarEntryId,
     string location)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.CalendarEntryId = calendarEntryId;
     this.Location = location;
 }
 public カレンダーエントリー詳細変更時(
     テナント tenant,
     カレンダーId calendarId,
     カレンダーエントリーId calendarEntryId,
     string description)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.CalendarEntryId = calendarEntryId;
     this.Description = description;
 }
 public ディスカッションにポスト時(テナント tenantId, フォーラムId forumId, ディスカッションId discussionId, ポストId postId, 著者 author, string subject, string bodyText, ポストId 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 フォーラム(テナント tenantId, フォーラムId forumId, クリエイタ creator, モデレータ 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 フォーラム開始時(tenantId, forumId, creator, moderator, subject, description, exclusiveOwner));
        }
 public カレンダーエントリー参加者非招待時(
     テナント tenant,
     カレンダーId calendarId,
     カレンダーエントリーId calendarEntryId,
     参加者 participant)
 {
     this.Tenant = tenant;
     this.CalendarId = calendarId;
     this.CalendarEntryId = calendarEntryId;
     this.Participant = participant;
 }
        public void AssignModeratorToForum(string tenantId, string forumId, string moderatorId)
        {
            var tenant = new テナント(tenantId);

            var forum = this.forumRepository.Get(tenant, new フォーラムId(forumId));

            var moderator = this.collaboratorService.GetModeratorFrom(tenant, moderatorId);

            forum.AssignModerator(moderator);

            this.forumRepository.Save(forum);
        }
        public void UninviteCalendarEntryParticipant(string tenantId, string calendarEntryId, ISet<string> participantsToUninvite)
        {
            var tenant = new テナント(tenantId);
            var calendarEntry = this.calendarEntryRepository.Get(tenant, new カレンダーエントリーId(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, Iカレンダーコマンド結果 calendarCommandResult)
        {
            var tenant = new テナント(tenantId);
            var owner = this.collaboratorService.GetOwnerFrom(tenant, ownerId);
            var sharers = GetSharersFrom(tenant, participantsToShareWith);

            var calendar = new カレンダー(tenant, this.calendarRepository.GetNextIdentity(), name, description, owner, sharers);

            this.calendarRepository.Save(calendar);

            calendarCommandResult.SetResultingCalendarId(calendar.CalendarId.Id);
        }
 public カレンダーエントリー再スケジュール時(
     テナント tenant,
     カレンダーId calendarId,
     カレンダーエントリーId calendarEntryId,
     データレンジ timeSpan,
     リピート repetition,
     アラーム 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 テナント(tenantId);

            var forum = this.forumRepository.Get(tenant, new フォーラムId(forumId));

            var moderator = this.collaboratorService.GetModeratorFrom(tenant, moderatorId);

            var post = this.postRepository.Get(tenant, new ポストId(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, Iカレンダーコマンド結果 calendarCommandResult)
        {
            var tenant = new テナント(tenantId);

            var calendar = this.calendarRepository.Get(tenant, new カレンダーId(calendarId));

            var calendarEntry = calendar.ScheduleCalendarEntry(
                this.calendarIdentityService,
                description,
                location,
                this.collaboratorService.GetOwnerFrom(tenant, ownerId),
                new データレンジ(timeSpanBegins, timeSpanEnds),
                new リピート((リピートタイプ)Enum.Parse(typeof(リピートタイプ), repeatType), repeatEndsOn),
                new アラーム((アラームユニットタイプ)Enum.Parse(typeof(アラームユニットタイプ), alarmType), alarmUnits),
                GetInviteesFrom(tenant, participantsToInvite));

            this.calendarEntryRepository.Save(calendarEntry);

            calendarCommandResult.SetResultingCalendarId(calendar.CalendarId.Id);
            calendarCommandResult.SetResultingCalendarEntryId(calendarEntry.CalendarEntryId.Id);
        }
 public カレンダーエントリースケジュール時(
     テナント tenant, 
     カレンダーId calendarId, 
     カレンダーエントリーId calendarEntryId, 
     string description, 
     string location, 
     オーナ owner, 
     データレンジ timeSpan, 
     リピート repetition,
     アラーム alarm,
     IEnumerable<参加者> 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;
 }
        public void StartExclusiveForumWithDiscussion(
            string tenantId,
            string exclusiveOwner,
            string creatorId,
            string moderatorId,
            string authorId,
            string forumSubject,
            string forumDescription,
            string discussionSubject,
            Iフォーラムコマンド結果 result = null)
        {
            var tenant = new テナント(tenantId);

            フォーラム forum = null;

            var forumId = this.forumQueryService.GetForumIdByExclusiveOwner(tenantId, exclusiveOwner);
            if (forumId != null)
            {
                forum = this.forumRepository.Get(tenant, new フォーラムId(forumId));
            }

            if (forum == null)
            {
                forum = StartNewForum(tenant, creatorId, moderatorId, forumSubject, forumDescription, exclusiveOwner);
            }

            ディスカッション discussion = null;

            var discussionId = this.discussionQueryService.GetDiscussionIdByExclusiveOwner(tenantId, exclusiveOwner);
            if (discussionId != null)
            {
                discussion = this.discussionRepository.Get(tenant, new ディスカッションId(discussionId));
            }

            if (discussion == null)
            {
                var author = this.collaboratorService.GetAuthorFrom(tenant, authorId);

                discussion = forum.StartDiscussionFor(this.forumIdentityService, author, discussionSubject, exclusiveOwner);

                this.discussionRepository.Save(discussion);
            }

            if (result != null)
            {
                result.SetResultingForumId(forum.ForumId.Id);
                result.SetResultingDiscussionId(discussion.DiscussionId.Id);
            }
        }
 void When(フォーラム開始時 e)
 {
     this.tenantId = e.TenantId;
     this.forumId = e.ForumId;
     this.creator = e.Creator;
     this.moderator = e.Moderator;
     this.subject = e.Subject;
     this.description = e.Description;
     this.exclusiveOwner = e.ExclusiveOwner;
 }
        フォーラム StartNewForum(
            テナント tenant,
            string creatorId,
            string moderatorId,
            string subject,
            string description,
            string exclusiveOwner)
        {
            var creator = this.collaboratorService.GetCreatorFrom(tenant, creatorId);

            var moderator = this.collaboratorService.GetModeratorFrom(tenant, moderatorId);

            var newForum = new フォーラム(
                        tenant,
                        this.forumRepository.GetNextIdentity(),
                        creator,
                        moderator,
                        subject,
                        description,
                        exclusiveOwner);

            this.forumRepository.Save(newForum);

            return newForum;
        }
        public void StartExclusiveForum(string tenantId, string exclusiveOwner, string creatorId, string moderatorId, string subject, string description, Iフォーラムコマンド結果 result = null)
        {
            var tenant = new テナント(tenantId);

            フォーラム forum = null;

            var forumId = this.forumQueryService.GetForumIdByExclusiveOwner(tenantId, exclusiveOwner);
            if (forumId != null)
            {
                forum = this.forumRepository.Get(tenant, new フォーラムId(forumId));
            }

            if (forum == null)
            {
                forum = StartNewForum(tenant, creatorId, moderatorId, subject, description, exclusiveOwner);
            }

            if (result != null)
            {
                result.SetResultingForumId(forum.ForumId.Id);
            }
        }
        public void ShareCalendarWith(string tenantId, string calendarId, ISet<string> participantsToShareWith)
        {
            var tenant = new テナント(tenantId);
            var calendar = this.calendarRepository.Get(tenant, new カレンダーId(calendarId));

            foreach (var sharer in GetSharersFrom(tenant, participantsToShareWith))
            {
                calendar.ShareCalendarWith(sharer);
            }

            this.calendarRepository.Save(calendar);
        }
 ISet<参加者> GetInviteesFrom(テナント tenant, ISet<string> participantsToInvite)
 {
     var invitees = new HashSet<参加者>();
     foreach (string participatnId in participantsToInvite)
     {
         var participant = this.collaboratorService.GetParticipantFrom(tenant, participatnId);
         invitees.Add(participant);
     }
     return invitees;
 }
 ISet<カレンダー共有> GetSharersFrom(テナント tenant, ISet<string> participantsToShareWith)
 {
     var sharers = new HashSet<カレンダー共有>();
     foreach (var participatnId in participantsToShareWith)
     {
         var participant = this.collaboratorService.GetParticipantFrom(tenant, participatnId);
         sharers.Add(new カレンダー共有(participant));
     }
     return sharers;
 }