Exemple #1
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            WMMessage message = value as WMMessage;

            if (message == null || !message.isFileMessage())
            {
                return(null);
            }
            WMBaseSession session = WebimController.Instance.RealtimeSession;

            if (session == null)
            {
                session = WebimController.Instance.OfflineSession;
            }
            if (session == null || !IsSupportedImage(message))
            {
                return(null);
            }

            Uri path = session.AttachmentUriForMessage(message);

            switch (message.Status)
            {
            case WMMessage.WMMessageStatus.Sent:
                return(new BitmapImage(path));

            case WMMessage.WMMessageStatus.NotSent:
                return(new BitmapImage(path));
            }
            return(null);
        }
 void session_SessionDidReceiveError(WMSession session, WMBaseSession.WMSessionError errorID)
 {
     UpdateCommandBarButtonsStates();
 }