예제 #1
0
        public AttachmentImage(AttachmentModel model)
            : base(model)
        {
            InitializeComponent();

            try
            {
                LoadAttachmentImage();
            }
            catch
            {
                LoadErrorImage();
            }
        }
        protected override void AddAttachment(IMessageAttachment messageAttachment)
        {
            UIElement attachmentElement;
            AttachmentModel attachmentModel = new AttachmentModel(_fileSystem, messageAttachment);
            switch (messageAttachment.Type)
            {
                case AttachmentType.Image:
                    attachmentElement = new AttachmentImage(attachmentModel);
                    break;
                case AttachmentType.Video:
                    attachmentElement = new AttachmentVideo(attachmentModel);
                    break;
                case AttachmentType.Audio:
                    attachmentElement = new AttachmentAudio(attachmentModel);
                    break;
                default:
                    throw new ArgumentException("Unrecognized attachment type: " + messageAttachment.Type.ToString());
            }

            _currentParagraph.Inlines.Add(attachmentElement);
        }
예제 #3
0
 public AttachmentAudio(AttachmentModel model)
     : base(model)
 {
     InitializeComponent();
 }
예제 #4
0
 public AttachmentBase(AttachmentModel model)
 {
     _model = model;
 }