Пример #1
0
        public bool PassFilter(MessageAttachment attachment)
        {
            var repositoryName = attachment.Pretext.Replace(">", "").Split('|').Last();

            return(!string.IsNullOrWhiteSpace(repositoryName) &&
                   repositoryName.StartsWith(_configuration.RepositoryPrefix));
        }
        public async Task Should_attach_attachment_when_command_have_attachment()
        {
            //arrange
            var message       = new AttachmentCommand();
            var nextProcessor = new Mock <IMessageProcessor>();
            var stream        = new MemoryStream(Encoding.UTF8.GetBytes("this is a stream"));
            var attachment    = new MessageAttachment("test.txt", "text/plain", stream);
            var stateHandler  = new Mock <IMessageStateHandler <AttachmentCommand> >();

            stateHandler.Setup(x => x.GetMessageAsync()).ReturnsAsync(message);
            stateHandler.Setup(x => x.MessageProperties).Returns(new Dictionary <string, string> {
                { AttachmentUtility.AttachmentKey, "89BDF3DB-896C-448D-A84E-872CBA8DBC9F" }
            });
            var attachmentProvider = new Mock <IMessageAttachmentProvider>();

            attachmentProvider.Setup(x => x.GetAttachmentAsync(AutoMessageMapper.GetQueueName <AttachmentCommand>(), It.IsAny <string>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(attachment);
            var middleware = new AttachmentMiddleware(attachmentProvider.Object);
            //act
            await middleware.ProcessAsync(stateHandler.Object, Mock.Of <IPipelineInformation>(), nextProcessor.Object, CancellationToken.None);

            //assert
            stream.CanRead.Should().BeFalse("It should have been disposed");
            message.Attachment.Filename.Should().Be("test.txt");
            message.Attachment.ContentType.Should().Be("text/plain");
            nextProcessor.Verify(x => x.ProcessAsync(stateHandler.Object, CancellationToken.None), Times.Once);
        }
Пример #3
0
 public void CreateTempCopyMissingBackupTest()
 {
     MockFileSystem           mockFileSystem = new MockFileSystem();
     IMessageAttachment       attachment     = new MessageAttachment(1, AttachmentType.Image, @"C:\backup\1", "abc.jpg");
     AttachmentModel_Accessor target         = new AttachmentModel_Accessor(mockFileSystem, attachment);
     string actual = target.CreateTempCopy();
 }
Пример #4
0
        public Result Delete(int id)
        {
            Result result = new Result();

            MessageAttachment attachment = GetById(id);

            if (attachment == null)
            {
                result.Add(lang.get("exDataNotFound"));
                return(result);
            }

            attachment.delete();

            String filePath = strUtil.Join(sys.Path.DiskPhoto, attachment.Url);
            String absPath  = PathHelper.Map(filePath);


            if (file.Exists(absPath))
            {
                try {
                    file.Delete(absPath);
                }
                catch (IOException ex) {
                    logger.Error(ex.ToString());
                    result.Add(ex.ToString());
                }
            }
            else
            {
                result.Add("文件不存在:" + absPath);
            }

            return(result);
        }
Пример #5
0
        public static byte[] GetMessageAttachment()
        {
            MessageAttachment attachment = default(MessageAttachment);

            PrxMessagingGetMessageAttachment(out attachment);
            return(attachment.data);
        }
Пример #6
0
        public List<MessageAttachment> Upload(IEnumerable<LocalResource> localResources)
        {
            List<MessageAttachment> result = new List<MessageAttachment>();

            if (null != localResources)
            {
                foreach (var res in localResources)
                {
                    Guid guid = Guid.NewGuid();

                    string fileName = Path.GetFileName(res.LocalPath);
                    string key = guid.ToString() + fileName;

                    TransferUtilityUploadRequest request = new TransferUtilityUploadRequest()
                        .WithBucketName(m_BucketName)
                        .WithFilePath(res.LocalPath)
                        .WithSubscriber(this.UploadFileProgressCallback)
                        .WithCannedACL(S3CannedACL.PublicRead)
                        .WithKey(key);
                    m_s3transferUtility.Upload(request);

                    MessageAttachment attachment = new MessageAttachment(new Uri(m_CloudFrontRoot, key), res.Description ?? fileName);
                    result.Add(attachment);
                }
            }

            return result;
        }
Пример #7
0
        public virtual void SaveMsgAttachment()
        {
            Result result = attachmentService.SaveFile(ctx.GetFileSingle());

            Dictionary <String, String> dic = new Dictionary <String, String>();

            if (result.HasErrors)
            {
                dic.Add("FileName", "");
                dic.Add("DeleteLink", "");
                dic.Add("Msg", result.ErrorsText);

                echoText(Json.ToString(dic));
            }
            else
            {
                MessageAttachment att        = result.Info as MessageAttachment;
                String            deleteLink = to(DeleteMsgAttachment, att.Id);

                dic.Add("FileName", att.Name);
                dic.Add("DeleteLink", deleteLink);
                dic.Add("Id", att.Id.ToString());

                echoText(Json.ToString(dic));
            }
        }
Пример #8
0
        public void ShouldConvertToMessageAttachmentForSticker()
        {
            // Arrange
            var fbAttachment = new FbAttachment
            {
                type  = "sticker",
                url   = "http://test/test.jpg",
                media = new FbAttachmentMedia
                {
                    image = new FbAttachmentImage
                    {
                        src = "http://test/123.jpg"
                    }
                }
            };
            var conveter = new FacebookConverter();

            // Act
            MessageAttachment message = conveter.ConvertToAttachment(fbAttachment);

            // Assert
            Assert.Equal(MessageAttachmentType.Image, message.Type);
            Assert.Equal(fbAttachment.url, message.OriginalLink);
            Assert.Equal(fbAttachment.media.image.src, message.PreviewUrl);
            Assert.Equal("image/jpeg", message.MimeType);
        }
Пример #9
0
        private void NormarlizeAttachmentType(MessageAttachment attachment)
        {
            if (!string.IsNullOrEmpty(attachment.MimeType))
            {
                if (attachment.MimeType.StartsWith("image/", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (attachment.Type != MessageAttachmentType.AnimatedImage)
                    {
                        attachment.Type = MessageAttachmentType.Image;
                    }
                }
                else if (attachment.MimeType.StartsWith("video/", StringComparison.InvariantCultureIgnoreCase))
                {
                    attachment.Type = MessageAttachmentType.Video;
                }

                else if (attachment.MimeType.StartsWith("audio/", StringComparison.InvariantCultureIgnoreCase))
                {
                    attachment.Type = MessageAttachmentType.Audio;
                }
                else
                {
                    attachment.Type = MessageAttachmentType.File;
                }
            }
        }
Пример #10
0
        private void saveAttachments(MessageData messageData, int[] attachmentIds)
        {
            if (attachmentIds == null || attachmentIds.Length == 0)
            {
                return;
            }

            int count = 0;

            foreach (int id in attachmentIds)
            {
                MessageAttachment att = MessageAttachment.findById(id);
                if (att == null)
                {
                    continue;
                }

                att.MessageData = messageData;
                att.update();

                count++;
            }

            if (count > 0)
            {
                messageData.AttachmentCount = count;
                messageData.update();
            }
        }
Пример #11
0
        public MessageAttachment attachToMessage(MessageAttachment attachment, Message message)
        {
            try
            {
                _cxn.beginTransaction();

                if (attachment.Id > 0)
                {
                    attachment = updateAttachment(attachment); // could simply rely on updateAttachment function but thought this might add a level of convenience
                }
                else if (attachment.Id <= 0)
                {
                    // create attachment
                    attachment = createAttachment(attachment.AttachmentName, attachment.SmFile, attachment.MimeType);
                    // update message - set attachment ID properties
                    message = updateMessageAttachmentFields(message, attachment.Id);
                }

                _cxn.commitTransaction();
                return(attachment);
            }
            catch (Exception)
            {
                _cxn.rollbackTransaction();
                throw;
            }
        }
Пример #12
0
 public bool IsSender( int viewerId, MessageAttachment attachment )
 {
     if (attachment.MessageData == null) return false;
     MessageData x = MessageData.findById( attachment.MessageData.Id );
     if (attachment.MessageData.Sender == null) return false;
     return attachment.MessageData.Sender.Id == viewerId;
 }
Пример #13
0
        public void ShouldNormalizeAttachmentType()
        {
            // Arrange
            var fbAttachment = new FbAttachment
            {
                type  = "animated_image",
                url   = "http://test/test.mp4",
                media = new FbAttachmentMedia
                {
                    image = new FbAttachmentImage
                    {
                        src = "http://test/123.jpg"
                    }
                }
            };
            var conveter = new FacebookConverter();

            // Act
            MessageAttachment message = conveter.ConvertToAttachment(fbAttachment);


            // Assert
            Assert.Equal(MessageAttachmentType.Video, message.Type);
            Assert.Equal("video/mp4", message.MimeType);
        }
Пример #14
0
        public MessageAttachment Add()
        {
            MessageAttachment item = new MessageAttachment();

            this.fItems.Add(item);

            return(item);
        }
Пример #15
0
 public bool IsReceiver( int viewerId, MessageAttachment attachment )
 {
     List<Message> msgList = Message.find( "MessageData.Id=" + attachment.MessageData.Id ).list();
     foreach (Message msg in msgList) {
         if (msg.Receiver.Id == viewerId) return true;
     }
     return false;
 }
Пример #16
0
        public bool PassFilter(MessageAttachment attachment)
        {
            var releaseField = attachment.Fields.FirstOrDefault(_ => _.Title == "Release");

            var releaseName = releaseField?.Value.Replace(">", "").Split('|').Last();

            return(!string.IsNullOrWhiteSpace(releaseName) &&
                   releaseName.StartsWith(_configuration.ReleasePrefix));
        }
Пример #17
0
        public MessageAttachment Add(String Name)
        {
            MessageAttachment item = new MessageAttachment();

            item.FileName = Name;

            fItems.Add(item);

            return(item);
        }
Пример #18
0
        internal MessageAttachment toAttachment(IDataReader rdr)
        {
            MessageAttachment ma = new MessageAttachment();

            if (rdr.Read())
            {
                ma = MessageAttachment.getAttachmentFromReader(rdr);
            }
            return(ma);
        }
Пример #19
0
        /// <summary>
        /// Handles the Click event of the AttachedConversationLink control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Windows.UI.Xaml.RoutedEventArgs" /> instance containing the event data.</param>
        private void AttachedConversationLink_Click(object sender, RoutedEventArgs e)
        {
            FrameworkElement element = (FrameworkElement)sender;
            Frame            frame   = (Frame)Window.Current.Content;
            MainPage         page    = (MainPage)frame.Content;

            MessageAttachment attachment = (MessageAttachment)element.Tag;

            // Force navigation to ensure that there is a conversation history maintained
            page.NavigateTo(typeof(ConversationPage), new ConversationPage.Arguments(attachment, false), true);
        }
Пример #20
0
        public domain.sm.MessageAttachment updateAttachment(MessageAttachment attachment)
        {
            OracleQuery request = buildUpdateAttachmentQuery(attachment);
            nonQuery    qry     = delegate() { return((Int32)request.Command.ExecuteNonQuery()); };

            if ((Int32)_cxn.query(request, qry) != 1)
            {
                throw new MdoException("Unable to update message attachment");
            }
            attachment.Oplock++;
            return(attachment);
        }
Пример #21
0
        public MessageAttachment Add(String name, Stream data, Boolean ownsData)
        {
            MessageAttachment item = new MessageAttachment();

            item.FileName = name;
            item.Data     = data;
            item.OwnsData = ownsData;

            fItems.Add(item);

            return(item);
        }
Пример #22
0
        public MessageAttachment ConvertToAttachment(FbAttachment attachment)
        {
            MessageAttachment result;

            if (attachment.type == "photo" || attachment.type == "sticker")
            {
                result = new MessageAttachment
                {
                    OriginalLink = attachment.url,
                    Url          = attachment.media.image.src,
                    PreviewUrl   = attachment.media.image.src,
                    Type         = MessageAttachmentType.Image,
                    MimeType     = new Uri(attachment.media.image.src).GetMimeType()
                };
            }
            else if (attachment.type.Contains("animated_image"))
            {
                result = new MessageAttachment
                {
                    OriginalLink = attachment.url,
                    PreviewUrl   = attachment.media.image.src,
                    Url          = attachment.url,
                    Type         = MessageAttachmentType.AnimatedImage,
                    MimeType     = new Uri(attachment.url).GetMimeType()
                };
            }

            else if (attachment.type.Contains("video"))
            {
                result = new MessageAttachment
                {
                    OriginalLink = attachment.url,
                    PreviewUrl   = attachment.media.image.src,
                    Url          = attachment.url,
                    Type         = MessageAttachmentType.Video,
                    MimeType     = new Uri(attachment.url).GetMimeType()
                };
            }
            else
            {
                result = new MessageAttachment
                {
                    OriginalLink = attachment.url,
                    Url          = attachment.url,
                    Type         = MessageAttachmentType.File,
                    MimeType     = new Uri(attachment.url).GetMimeType()
                };
            }

            NormarlizeAttachmentType(result);
            return(result);
        }
Пример #23
0
        public void CreateTempCopyExistingBackupTest()
        {
            MockFileSystem mockFileSystem = new MockFileSystem();
            const string   BackupPath     = @"C:\backup\034234aaljkadfalakdjladfaljkdadfa";

            mockFileSystem.CreateNewFile(BackupPath);

            IMessageAttachment       attachment = new MessageAttachment(6, AttachmentType.Image, BackupPath, "IMG_003.JPG");
            AttachmentModel_Accessor target     = new AttachmentModel_Accessor(mockFileSystem, attachment);
            string copiedFilePath = target.CreateTempCopy();

            Assert.IsNotNull(copiedFilePath);
        }
Пример #24
0
        public bool PassFilter(MessageAttachment attachment)
        {
            var buildDefinitionField = attachment.Fields.FirstOrDefault(_ => _.Title == "Build pipeline");

            if (buildDefinitionField == null)
            {
                return(false);
            }

            var buildDefinition = _vstsClient.GetBuildDefinitionByName(buildDefinitionField.Value);

            return(buildDefinition.Path.TrimStart('\\').Equals(_configuration.BuildPath, StringComparison.InvariantCultureIgnoreCase));
        }
Пример #25
0
        public static MessageJoinedFile ToModel(this MessageAttachment attachment)
        {
            if (attachment == null)
            {
                throw new ArgumentNullException(nameof(attachment));
            }

            return(new MessageJoinedFile
            {
                Id = attachment.Id,
                Link = attachment.Link
            });
        }
Пример #26
0
        public bool IsReceiver(int viewerId, MessageAttachment attachment)
        {
            List <Message> msgList = Message.find("MessageData.Id=" + attachment.MessageData.Id).list();

            foreach (Message msg in msgList)
            {
                if (msg.Receiver.Id == viewerId)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #27
0
        public dto.sm.AttachmentTO addAttachment(string pwd, Int32 messageId, Int32 messageOplock, string fileName, string mimeType, AttachmentTO attachment)
        {
            AttachmentTO result = new AttachmentTO();

            pwd = getConnectionString(pwd);

            if (String.IsNullOrEmpty(pwd))
            {
                result.fault = new FaultTO("No connection string specified or configured");
            }
            else if (messageId <= 0)
            {
                result.fault = new FaultTO("Invalid message ID");
            }
            else if (String.IsNullOrEmpty(fileName) || String.IsNullOrEmpty(mimeType) || attachment == null || attachment.attachment == null || attachment.attachment.Length <= 0)
            {
                result.fault = new FaultTO("Must supply all attachment properties");
            }

            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                using (MdoOracleConnection cxn = new MdoOracleConnection(new mdo.DataSource()
                {
                    ConnectionString = pwd
                }))
                {
                    AttachmentDao     dao           = new AttachmentDao(cxn);
                    MessageAttachment newAttachment = dao.attachToMessage(
                        new MessageAttachment()
                    {
                        AttachmentName = fileName, MimeType = mimeType, SmFile = attachment.attachment
                    },
                        new Message()
                    {
                        Id = messageId, Oplock = messageOplock
                    });
                    result = new AttachmentTO(newAttachment);
                }
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }

            return(result);
        }
Пример #28
0
        public virtual bool IsSender(long viewerId, MessageAttachment attachment)
        {
            if (attachment.MessageData == null)
            {
                return(false);
            }
            MessageData x = MessageData.findById(attachment.MessageData.Id);

            if (attachment.MessageData.Sender == null)
            {
                return(false);
            }
            return(attachment.MessageData.Sender.Id == viewerId);
        }
Пример #29
0
        private static MessageAttachment ConvertToMessageAttachment(IMediaEntity media)
        {
            var messageAttachment      = new MessageAttachment {
            };
            MessageAttachmentType type = MessageAttachmentType.File;

            if (media.MediaType == "animated_gif")
            {
                type = MessageAttachmentType.AnimatedImage;
            }
            if (media.MediaType == "photo")
            {
                type = MessageAttachmentType.Image;
            }
            if (media.MediaType == "vedio" || media.MediaType == "video")
            {
                type = MessageAttachmentType.Video;
            }
            messageAttachment = new MessageAttachment
            {
                Type         = type,
                Url          = media.MediaURL,
                PreviewUrl   = media.MediaURL,
                MimeType     = new Uri(media.MediaURL).GetMimeType(),
                OriginalId   = media.IdStr,
                OriginalLink = media.URL
            };
            if (media.VideoDetails != null && media.VideoDetails.Variants.Any())
            {
                var video = media.VideoDetails.Variants.FirstOrDefault(t => t.Bitrate > 0);
                if (video == null)
                {
                    video = media.VideoDetails.Variants.FirstOrDefault();
                }

                messageAttachment = new MessageAttachment
                {
                    Type         = type,
                    Url          = video.URL,
                    PreviewUrl   = media.MediaURL,
                    MimeType     = video.ContentType,
                    OriginalId   = media.IdStr,
                    OriginalLink = media.URL
                };
            }

            NormarlizeAttachmentType(messageAttachment);

            return(messageAttachment);
        }
Пример #30
0
        private void LoadAttachment(MessageAttachment attachment, ILoadingProgressCallback progressCallback)
        {
            CheckForCancel(progressCallback);

            try
            {
                TextMessage matchingMessage = _messageLookupTable[attachment.MessageId];
                matchingMessage.AddAttachment(attachment);
            }
            catch (KeyNotFoundException)
            {
                ;
            }

            IncrementWorkProgress(progressCallback);
        }
Пример #31
0
        private void LoadAttachment(MessageAttachment attachment, ILoadingProgressCallback progressCallback)
        {
            CheckForCancel(progressCallback);

            try
            {
                TextMessage matchingMessage = _messageLookupTable[attachment.MessageId];
                matchingMessage.AddAttachment(attachment);
            }
            catch (KeyNotFoundException)
            {
                ;
            }

            IncrementWorkProgress(progressCallback);
        }
Пример #32
0
        public dto.sm.AttachmentTO updateAttachment(string pwd, Int32 attachmentId, Int32 attachmentOplock, string fileName, string mimeType, AttachmentTO newAttachment)
        {
            AttachmentTO result = new AttachmentTO();

            pwd = getConnectionString(pwd);

            if (String.IsNullOrEmpty(pwd))
            {
                result.fault = new FaultTO("No connection string specified or configured");
            }
            else if (attachmentId <= 0)
            {
                result.fault = new FaultTO("Invalid attachment ID");
            }
            else if (String.IsNullOrEmpty(fileName) || String.IsNullOrEmpty(mimeType) || newAttachment == null || newAttachment.attachment == null || newAttachment.attachment.Length <= 0)
            {
                result.fault = new FaultTO("Must supply all attachment properties");
            }

            if (result.fault != null)
            {
                return(result);
            }
            try
            {
                using (MdoOracleConnection cxn = new MdoOracleConnection(new mdo.DataSource()
                {
                    ConnectionString = pwd
                }))
                {
                    AttachmentDao     dao = new AttachmentDao(cxn);
                    MessageAttachment updatedAttachment = dao.updateAttachment(new MessageAttachment()
                    {
                        Id = attachmentId, Oplock = attachmentOplock, AttachmentName = fileName, MimeType = mimeType, SmFile = newAttachment.attachment
                    });
                    updatedAttachment.SmFile = null; // don't pass back - client already has image so save the bandwidth
                    result = new AttachmentTO(updatedAttachment);
                }
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }

            return(result);
        }
Пример #33
0
        public static async Task <PostMessageRequest> GetPrepareVideoReminder(IBinder binder, Plan plan)
        {
            var proposal = await binder.GetTableRow <Proposal>("proposals", plan.PartitionKey, plan.Video);

            var attachment = new MessageAttachment {
                Fields =
                {
                    new AttachmentField {
                        Title = "Proposé par",
                        Value = $"<@{proposal.ProposedBy}>",
                        Short = true
                    },
                    new AttachmentField {
                        Title = "Proposé dans",
                        Value = $"<#{proposal.Channel}>",
                        Short = true
                    },
                    new AttachmentField {
                        Title = "Nom du vidéo",
                        Value = proposal.Name + (proposal.Part > 1 ? $" [{proposal.Part}e partie]" : ""),
                        Short = true
                    },
                    new AttachmentField {
                        Title = "Emplacement",
                        Value = proposal.Url,
                        Short = true
                    }
                }
            };

            if (!String.IsNullOrWhiteSpace(proposal.Notes))
            {
                attachment.Fields.Add(new AttachmentField {
                    Title = "Notes",
                    Value = proposal.Notes
                });
            }

            var message = new PostMessageRequest {
                Channel     = plan.Owner,
                Text        = "Rappel: Vous êtes *responsable* du vidéo de ce midi. Tout doit être prêt pour démarrer à 12:10!",
                Attachments = { attachment }
            };

            return(message);
        }
Пример #34
0
        public domain.sm.MessageAttachment createAttachment(string attachmentName, byte[] attachment, string mimeType)
        {
            OracleQuery request = buildCreateAttachmentQuery(attachmentName, attachment, mimeType);
            nonQuery    qry     = delegate() { return((Int32)request.Command.ExecuteNonQuery()); };

            if ((Int32)_cxn.query(request, qry) != 1)
            {
                throw new MdoException("Unable to insert new message attachment");
            }
            MessageAttachment result = new MessageAttachment()
            {
                AttachmentName = attachmentName, MimeType = mimeType
            };

            result.Id = ((Oracle.DataAccess.Types.OracleDecimal)request.Command.Parameters["outId"].Value).ToInt32();
            return(result);
        }
Пример #35
0
 /// <summary>
 /// Post message in the wall
 /// </summary>
 /// <param name="ownerId">if null - wall entry for current user will be posted, else - for specified user</param>
 /// <param name="message">message to be posted</param>
 /// <param name="attachment">attachment to be added to wall post</param>
 /// <param name="services">services wich this post be reposted</param>
 /// <returns>message id</returns>
 public int Post(int? ownerId, string message, MessageAttachment attachment, string[] services)
 {
     return this.Post(ownerId, message, new MessageAttachment[]{ attachment}, services);
 }
Пример #36
0
 public static MessageAttachment CreateMessageAttachment(global::System.Guid attachmentId)
 {
     MessageAttachment messageAttachment = new MessageAttachment();
     messageAttachment.AttachmentId = attachmentId;
     return messageAttachment;
 }
Пример #37
0
        public int Post(int? ownerId, string message, MessageAttachment[] attachments, string[] services)
        {
            this.Manager.Method("wall.post", new object[] { "owner_id", ownerId,
                                    "message", message,
                                    "attachment", attachments,
                                    "services", ((services != null)?String.Join(",", services):null) });
            XmlDocument x = this.Manager.Execute().GetResponseXml();

            return Convert.ToInt32(x.InnerText);
        }
Пример #38
0
 public void AddToMessageAttachment(MessageAttachment messageAttachment)
 {
     base.AddObject("MessageAttachment", messageAttachment);
 }
Пример #39
0
 public void Insert( MessageAttachment attachment )
 {
     attachment.insert();
 }
Пример #40
0
        public Result SaveFile( HttpFile postedFile )
        {
            Dictionary<String, String> dic = new Dictionary<String, String>();

            Result result = Uploader.SaveFile( postedFile );
            if (result.HasErrors) return result;

            MessageAttachment att = new MessageAttachment();
            att.Name = System.IO.Path.GetFileName( postedFile.FileName );
            att.Url = result.Info.ToString();
            att.Type = System.IO.Path.GetExtension( postedFile.FileName );
            att.FileSize = postedFile.ContentLength;

            this.Insert( att );

            result.Info = att;

            return result;
        }
Пример #41
0
 public int Post(int? ownerId, string message, MessageAttachment[] attachments)
 {
     return this.Post(ownerId, message, attachments, null);
 }
Пример #42
0
 public static MessageAttachment CreateMessageAttachment(string attachmentId)
 {
     MessageAttachment messageAttachment = new MessageAttachment();
     messageAttachment.AttachmentId = attachmentId;
     return messageAttachment;
 }