コード例 #1
0
ファイル: MessageViewModel.cs プロジェクト: ascott18/Mailer
        /// <summary>
        ///     Add an attachment with the specified path to the message.
        /// </summary>
        /// <param name="path"></param>
        public AttachmentViewModel AddAttachment(string path)
        {
            var avm = new AttachmentViewModel(this)
            {
                FileName = Path.GetFileName(path),
                FullPath = path
            };

            Attachments.Add(avm);

            return(avm);
        }
コード例 #2
0
ファイル: MessageViewModel.cs プロジェクト: ascott18/Mailer
 /// <summary>
 ///     Removes the specified AttachmentViewModel from the message.
 /// </summary>
 /// <param name="attachmentViewModel">The AttachmentViewModel to remove.</param>
 public void RemoveAttachment(AttachmentViewModel attachmentViewModel)
 {
     Attachments.Remove(attachmentViewModel);
 }