FeedNew() public static method

public static FeedNew ( ) : Feed
return Feed
コード例 #1
0
        internal static void FeedAdd(string action, Note note)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Note, note.NoteId);

            switch ((SourceType)note.SourceTypeId)
            {
            case SourceType.Project:
                feed.Sources.Add(SourceType.Project, note.SourceId);
                break;

            case SourceType.Sprint:
                var sprint = SprintRepository.SprintFetch(note.SourceId);
                feed.Sources.Add(SourceType.Project, sprint.ProjectId);
                feed.Sources.Add(SourceType.Sprint, sprint.SprintId);
                break;

            case SourceType.Story:
                var story = StoryRepository.StoryFetch(note.SourceId);
                feed.Sources.Add(SourceType.Project, story.ProjectId);
                feed.Sources.Add(SourceType.Story, story.StoryId);
                break;
            }

            feed.Description = note.Body;

            feed.Save();
        }
コード例 #2
0
        internal static void FeedAdd(string action, ProjectUser projectUser)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.ProjectUser, projectUser.ProjectUserMemberId);

            feed.Sources.Add(SourceType.Project, projectUser.ProjectId);
            feed.Sources.Add(SourceType.User, projectUser.UserId);

            feed.Save();
        }
コード例 #3
0
        internal static void FeedAdd(string action, Project project)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Project, project.ProjectId);

            if (action == FeedAction.Edited)
            {
                feed.Description = project.Auditor.Audit(project);
            }
            else
            {
                feed.Description = project.Description;
            }

            feed.Save();
        }
コード例 #4
0
        internal static void FeedAdd(string action, Story story)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Story, story.StoryId);

            if (action == FeedAction.Edited)
            {
                feed.Description = story.Auditor.Audit(story);
            }
            else
            {
                feed.Description = story.Description;
            }

            feed.Sources.Add(SourceType.Project, story.ProjectId);

            feed.Save();
        }
コード例 #5
0
        internal static void FeedAdd(string action, Sprint sprint)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Sprint, sprint.SprintId);

            if (action == FeedAction.Edited)
            {
                feed.Description = sprint.Auditor.Audit(sprint);
            }
            else
            {
                feed.Description = sprint.Description;
            }

            feed.Sources.Add(SourceType.Project, sprint.ProjectId);

            feed.Save();
        }
コード例 #6
0
        internal static void FeedAdd(string action, Hour hour)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Hour, hour.HourId);

            if (action == FeedAction.Edited)
            {
                feed.Description = hour.Auditor.Audit(hour);
            }
            else
            {
                feed.Description = hour.Notes;
            }

            feed.Sources.Add(SourceType.Project, hour.ProjectId);
            feed.Sources.Add(SourceType.Story, hour.StoryId);
            feed.Sources.Add(SourceType.User, hour.UserId);

            feed.Save();
        }