Der Login läuft jetzt mit RestSharp.
Die Akzentfarbe von den Chatgruppen vom Server wird berücksichtigt. Bilder sind im richtigen Seitenverhältnis skaliert. Ein Bild, das man gerade erst verschickt hat und das man öffnen will, bevor es auf dem Server angekommen ist, wird jetzt erst angezeigt, sobald es auf dem Server ist. Die Textbox für eine neue Nachricht wird nur angezeigt, wenn eine Gruppe ausgewählt ist und wenn man das Recht hat Nachrichten an diese Gruppe zu verschicken. Diverse Codeverbesserungen.
This commit is contained in:
@@ -1,163 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using ChatController.HauptKlassen;
|
||||
|
||||
namespace ChatController
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ChatEmojiiControl.xaml
|
||||
/// </summary>
|
||||
public partial class ChatEmojiiControl : UserControl
|
||||
public partial class ChatEmojiiControl
|
||||
{
|
||||
private ChatMainControl _ChatMainControl;
|
||||
private readonly ChatEmoji _ChatEmoji;
|
||||
|
||||
ChatMainControl chatView;
|
||||
private ChatEmoji _emojii;
|
||||
private readonly List<ListBox> _EmojiListBoxes = new List<ListBox>();
|
||||
|
||||
public ChatEmojiiControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_emojii = new ChatEmoji();
|
||||
|
||||
_ChatEmoji = new ChatEmoji();
|
||||
|
||||
SetEmojis();
|
||||
}
|
||||
|
||||
public void InitChatView(ChatMainControl c)
|
||||
public void InitChatView(ChatMainControl chatMainControl)
|
||||
{
|
||||
chatView = c;
|
||||
_ChatMainControl = chatMainControl;
|
||||
}
|
||||
|
||||
public void SetEmojis()
|
||||
{
|
||||
EmojisListBox1.ItemsSource = _emojii.EmojisListBox1;
|
||||
EmojisListBox2.ItemsSource = _emojii.EmojisListBox2;
|
||||
EmojisListBox3.ItemsSource = _emojii.EmojisListBox3;
|
||||
EmojisListBox4.ItemsSource = _emojii.EmojisListBox4;
|
||||
EmojisListBox5.ItemsSource = _emojii.EmojisListBox5;
|
||||
EmojisListBox6.ItemsSource = _emojii.EmojisListBox6;
|
||||
EmojisListBox7.ItemsSource = _emojii.EmojisListBox7;
|
||||
EmojisListBox1.ItemsSource = _ChatEmoji.EmojisListBox1;
|
||||
EmojisListBox2.ItemsSource = _ChatEmoji.EmojisListBox2;
|
||||
EmojisListBox3.ItemsSource = _ChatEmoji.EmojisListBox3;
|
||||
EmojisListBox4.ItemsSource = _ChatEmoji.EmojisListBox4;
|
||||
EmojisListBox5.ItemsSource = _ChatEmoji.EmojisListBox5;
|
||||
EmojisListBox6.ItemsSource = _ChatEmoji.EmojisListBox6;
|
||||
EmojisListBox7.ItemsSource = _ChatEmoji.EmojisListBox7;
|
||||
|
||||
TabItem1.Header = _emojii.TabItem1;
|
||||
TabItem2.Header = _emojii.TabItem2;
|
||||
TabItem3.Header = _emojii.TabItem3;
|
||||
TabItem4.Header = _emojii.TabItem4;
|
||||
TabItem5.Header = _emojii.TabItem5;
|
||||
TabItem6.Header = _emojii.TabItem6;
|
||||
TabItem7.Header = _emojii.TabItem7;
|
||||
_EmojiListBoxes.AddRange(
|
||||
new List<ListBox>
|
||||
{
|
||||
EmojisListBox1,
|
||||
EmojisListBox2,
|
||||
EmojisListBox3,
|
||||
EmojisListBox4,
|
||||
EmojisListBox5,
|
||||
EmojisListBox6,
|
||||
EmojisListBox7
|
||||
}
|
||||
);
|
||||
|
||||
TabItem1.Header = _ChatEmoji.TabItem1;
|
||||
TabItem2.Header = _ChatEmoji.TabItem2;
|
||||
TabItem3.Header = _ChatEmoji.TabItem3;
|
||||
TabItem4.Header = _ChatEmoji.TabItem4;
|
||||
TabItem5.Header = _ChatEmoji.TabItem5;
|
||||
TabItem6.Header = _ChatEmoji.TabItem6;
|
||||
TabItem7.Header = _ChatEmoji.TabItem7;
|
||||
}
|
||||
|
||||
private void OnEmojiClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox1.SelectedItems)
|
||||
foreach(var emojiListBox in _EmojiListBoxes)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
foreach(var selectedItem in emojiListBox.SelectedItems)
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
var directoryListing = selectedItem as DirectoryListing;
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(directoryListing?.EmojiCode))
|
||||
{
|
||||
PassEmojiToChatMainControl(directoryListing.EmojiCode);
|
||||
}
|
||||
}
|
||||
|
||||
emojiListBox.SelectedIndex = -1;
|
||||
}
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox2.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox3.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox4.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox5.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox6.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Object selecteditem in EmojisListBox7.SelectedItems)
|
||||
{
|
||||
DirectoryListing Item = selecteditem as DirectoryListing;
|
||||
|
||||
if (Item.EmojiCode != "")
|
||||
{
|
||||
ÜbergebeEmojiAnChatView(Item.EmojiCode, Item.Pfad);
|
||||
}
|
||||
}
|
||||
|
||||
EmojisListBox1.SelectedIndex = -1;
|
||||
EmojisListBox2.SelectedIndex = -1;
|
||||
EmojisListBox3.SelectedIndex = -1;
|
||||
EmojisListBox4.SelectedIndex = -1;
|
||||
EmojisListBox5.SelectedIndex = -1;
|
||||
EmojisListBox6.SelectedIndex = -1;
|
||||
EmojisListBox7.SelectedIndex = -1;
|
||||
|
||||
// ChatEmojiView.Activate();
|
||||
}
|
||||
|
||||
public void ÜbergebeEmojiAnChatView(string emojiicode, string muell)
|
||||
public void PassEmojiToChatMainControl(string emojiCode)
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(
|
||||
DispatcherPriority.Normal,
|
||||
(ThreadStart)delegate
|
||||
(ThreadStart) delegate
|
||||
{
|
||||
chatView.Chatbox.Focus();
|
||||
chatView.Chatbox.Text += " " + emojiicode;
|
||||
chatView.Chatbox.SelectionStart = chatView.Chatbox.Text.Length;
|
||||
|
||||
_ChatMainControl.Chatbox.Focus();
|
||||
_ChatMainControl.Chatbox.Text += emojiCode;
|
||||
_ChatMainControl.Chatbox.SelectionStart = _ChatMainControl.Chatbox.Text.Length;
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -165,6 +97,5 @@ namespace ChatController
|
||||
MessageBox.Show(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user