private async void messageReceived(Skype4Sharp.ChatMessage pMessage) { if ((chat != null && pMessage.Chat.ID == chat.ID) || (user != null && pMessage.Sender.Username == user.Username)) { int charID = await CharacterUtil.CharacterManager.GetCharIDForUser(pMessage.Sender); string animName = CharacterUtil.Words2Anim.convertToAnim(pMessage.Body); await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { receivedMessageBlock.Text = pMessage.Body; receiverBubblePop.Begin(); if (chat != null && chat.Type == Skype4Sharp.Enums.ChatType.Group) { int ind = Array.IndexOf(othersCharIds, charID); double leftMargin = (ActualWidth / othersCharIds.Length) * (othersCharIds.Length - ind - 1); receiverBubble.Margin = new Thickness(leftMargin, 100, 0, 0); Interoperation.idleAllAnimation(); Interoperation.setAnimationNames(ind, animName); } else { receiverBubble.Margin = new Thickness(20, 100, 0, 0); Interoperation.setAnimationName(animName); } }); } else { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { unreadMark.Visibility = Visibility.Visible; }); } }
private async Task loadCharacter() { unityMask.Visibility = Visibility.Visible; progressBar.Visibility = Visibility.Visible; await waitForLevel(); await setCharID(); Interoperation.setSelfCharacterID(await getSelfCharID()); await waitForCharacterChanged(); await waitForSelfCharacterChanged(); unityMask.Visibility = Visibility.Collapsed; progressBar.Visibility = Visibility.Collapsed; }
private async Task setCharID() { int ind = -1; if (chat != null) { if (chat.Type == Skype4Sharp.Enums.ChatType.Group) { Skype4Sharp.User[] users = await chat.getParticipants(); List <Skype4Sharp.User> others = new List <Skype4Sharp.User>(); for (int i = 0; i < users.Length; i++) { if (users[i].Username != App.mainSkype.selfProfile.Username) { others.Add(users[i]); if (chat != null && chat.LastMessage.Body != null && chat.LastMessage.Sender != null && users[i].Username == chat.LastMessage.Sender.Username) { ind = others.Count - 1; } } } othersCharIds = await CharacterUtil.CharacterManager.GetCharIDsForUsers(others); Interoperation.setCharacterIDs(othersCharIds); } else { Interoperation.setCharacterID(await CharacterUtil.CharacterManager.GetCharIDForUser(chat.mainParticipant)); } } else { Interoperation.setCharacterID(await CharacterUtil.CharacterManager.GetCharIDForUser(user)); } if (ind != -1) { double leftMargin = (ActualWidth / othersCharIds.Length) * (othersCharIds.Length - ind - 1); receiverBubble.Margin = new Thickness(leftMargin, 100, 0, 0); } else { receiverBubble.Margin = new Thickness(20, 100, 0, 0); } }
private async Task sendMessage() { string messageText = messageTextBox.Text; if (messageText != "") { messageTextBox.Text = ""; string animName = CharacterUtil.Words2Anim.convertToAnim(messageText); Interoperation.setSelfAnimationName(animName); sentMessageBlock.Text = messageText; senderBubblePop.Begin(); if (chat != null) { await App.mainSkype.SendMessage(chat, messageText); } else if (user != null) { await App.mainSkype.SendMessage(user, messageText); } App.recentNeedUpdate = true; } }
public MainWindow() { InitializeComponent(); _Interop = new Interoperation(); }
private void LoadTinyFS() { try { _Interop = new Interoperation(); //int ret = _Interop.LoadTinyFSAssemble(_Config.TinyFSFile); //if (ret == 0) //{ // MessageBox.Show("Load TinyFS.dll Failed, RLTools will shutdown!", // "Fatal Error!", MessageBoxButton.OK, MessageBoxImage.Error); // this.Close(); //} } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void arButton_Click(object sender, RoutedEventArgs e) { Interoperation.switchARMode(); }