コード例 #1
0
        public static Feed FeedAdd(string action, Label label)
        {
            var feed = FeedService.FeedNew();

            feed.Type = "Label";
            feed.Data = string.Format(
                "Action={0}|Name={1}|SourceType={2}|SourceId={3}|SourceName={4}",
                action,
                label.Name,
                (int)label.SourceType,
                label.SourceId,
                ForeignKeyMapper.FetchSourceName(label.SourceType, label.SourceId));

            feed = FeedService.FeedSave(feed);

            return(feed);
        }
コード例 #2
0
        public static Feed FeedAdd(string action, Note note)
        {
            var feed = FeedService.FeedNew();

            feed.Type = "Note";
            feed.Data = string.Format(
                "Action={0}|NoteId={1}|SourceType={2}|SourceId={3}|SourceName={4}|Text={5}",
                action,
                note.NoteId,
                (int)note.SourceType,
                note.SourceId,
                ForeignKeyMapper.FetchSourceName(note.SourceType, note.SourceId),
                note.Body);

            feed = FeedService.FeedSave(feed);

            return(feed);
        }
コード例 #3
0
        public static Feed FeedAdd(string action, Attachment attachment)
        {
            var feed = FeedService.FeedNew();

            feed.Type = "Attachment";
            feed.Data = string.Format(
                "Action={0}|AttachmentId={1}|SourceType={2}|SourceId={3}|SourceName={4}|Text={5}",
                action,
                attachment.AttachmentId,
                (int)attachment.SourceType,
                attachment.SourceId,
                ForeignKeyMapper.FetchSourceName(attachment.SourceType, attachment.SourceId),
                attachment.Name);

            feed = FeedService.FeedSave(feed);

            return(feed);
        }