public ChatViewModel(ConversatinInfoViewModel conversationInfo, BusinessCoreService business) { _conversationInfo = conversationInfo; ConversationId = _conversationInfo.Info.TargetId; _businessCoreService = business; _businessCoreService.Subscribe(CommandTypeEnum.HistoryMessage, HistoryMessageCallBack); _businessCoreService.Subscribe(CommandTypeEnum.Receive, ReceiveCallBack); _businessCoreService.Subscribe(CommandTypeEnum.GetDiscussionInfo, GetDiscussionInfoCallBack); _businessCoreService.GetHistoryMessage(conversationInfo.Info.TargetId, _conversationInfo.Info.ConversationType); Members = new ObservableCollection<UserInfo>(); if (_conversationInfo.Info.ConversationType == ConversationType.PRIVATE) { MembersTemp.Add(_businessCoreService.GetContacts().SingleOrDefault(x => x.Id == _conversationInfo.Info.TargetId)); } else if (_conversationInfo.Info.ConversationType == ConversationType.DISCUSSION) { _businessCoreService.GetDiscussionInfo(conversationInfo.Info.TargetId); } _imageCallBack = new ImageListenerEventHandler(this.UploadedCallBack); StartTimer(); _isExpandMember = false; MyWebClient.UploadFileCompleted += myWebClient_UploadFileCompleted; MyWebClient.UploadProgressChanged += myWebClient_UploadProgressChanged; _name = conversationInfo.Info.TargertName; }
public void SendImage(string targetId, string senderId, byte[] srcImgBytes, ConversationType type, Action<string> uploadingCallBack, Action<string> uploadedCallBack) { ImageListenerEventHandler imageCallBack = new ImageListenerEventHandler(uploadedCallBack); ImageListenerEventHandler imageProcessCallBack = new ImageListenerEventHandler(uploadingCallBack); Rcsdk.UpLoadFile(targetId, 1, 1, srcImgBytes, srcImgBytes.Length, imageCallBack, imageProcessCallBack); }
public static extern void DownLoadFile(string targetId, int categoryId, int nType, string pszUrl, ImageListenerEventHandler callback, ImageListenerEventHandler process_callback);
public static extern void UpLoadFile(string targetId, int categoryId, int nType, byte[] pbData/*string data*/, int nl, ImageListenerEventHandler callback, ImageListenerEventHandler process_callback);