tr
This commit is contained in:
@@ -4,65 +4,53 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Media.TextFormatting;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using BeWo.View;
|
||||
|
||||
using ChatController.ChatKlassen;
|
||||
using ChatController.HauptKlassen;
|
||||
using ChatController.Klassen;
|
||||
|
||||
using Path = System.IO.Path;
|
||||
|
||||
namespace ChatController
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ChatMainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class ChatMainControl : UserControl
|
||||
public partial class ChatMainControl
|
||||
{
|
||||
#region Vokabeln
|
||||
private Chat _chat;
|
||||
private AktuellerKontakt _aktuellerKontakt;
|
||||
private Chat _Chat;
|
||||
private AktuellerKontakt _AktuellerKontakt;
|
||||
|
||||
private bool isChatBoxOnFocus = false;
|
||||
private bool _IsChatBoxOnFocus;
|
||||
|
||||
private ChatEmojiiControl _emojiView;
|
||||
private ChatEmojiiControl _EmojiView;
|
||||
|
||||
private IOrderedEnumerable<ChatMessage> _Orderedmessagelist;
|
||||
private IOrderedEnumerable<KontaktlistBuilder> _kontaktlist;
|
||||
private IOrderedEnumerable<ChatMessage> _OrderedMessages;
|
||||
private IOrderedEnumerable<KontaktlistBuilder> _ContactList;
|
||||
|
||||
private ChatDatenUebergabe _chatDaten;
|
||||
private bool _ScrollPrueferAktivieren;
|
||||
|
||||
private bool scrollPrueferAktivieren = false;
|
||||
|
||||
public Thread newThread;
|
||||
private Thread _NewThread;
|
||||
public bool disableKontaktNachrichtenThread = true;
|
||||
|
||||
public Thread AlleKontakteThread;
|
||||
public bool AlleNachrichtenThreadBool = true;
|
||||
private double? AlleNachrichtenCount = null;
|
||||
private List<String> createdTempFiles = new List<String>();
|
||||
private Thread _AlleKontakteThread;
|
||||
public bool _AlleNachrichtenThreadBool = true;
|
||||
private readonly List<string> _CreatedTempFiles = new List<string>();
|
||||
|
||||
private Dictionary<String, Action<string>> menuItemName2Callback = new Dictionary<string, Action<string>>();
|
||||
private Dictionary<string, Action<string>> _MenuItemName2Callback = new Dictionary<string, Action<string>>();
|
||||
|
||||
public delegate void CloseDelegate();
|
||||
|
||||
public event CloseDelegate OnClose;
|
||||
|
||||
private bool _isDesktopVersion = true;
|
||||
private bool _IsDesktopVersion = true;
|
||||
#endregion
|
||||
|
||||
public ChatMainControl()
|
||||
@@ -73,14 +61,13 @@ namespace ChatController
|
||||
|
||||
public void InitMitChatdaten(ChatDatenUebergabe cdu)
|
||||
{
|
||||
_chatDaten = cdu;
|
||||
_chat = new Chat(cdu);
|
||||
_Chat = new Chat(cdu);
|
||||
|
||||
_kontaktlist = _chat.GroupklassenInChatKontakteUmwandler();
|
||||
_ContactList = _Chat.GroupklassenInChatKontakteUmwandler();
|
||||
|
||||
Clientlist.ItemsSource = _kontaktlist;
|
||||
Clientlist.ItemsSource = _ContactList;
|
||||
|
||||
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
|
||||
var view = (CollectionView) CollectionViewSource.GetDefaultView(Clientlist.ItemsSource);
|
||||
view.Filter = UserFilter;
|
||||
|
||||
HorcheAlleGruppenNachrichten();
|
||||
@@ -89,73 +76,50 @@ namespace ChatController
|
||||
Clientlist.Items.Refresh();
|
||||
}
|
||||
|
||||
public AktuellerKontakt GetAktuellenKontakt()
|
||||
public AktuellerKontakt GetCurrentContact()
|
||||
{
|
||||
if (AktChatUserList != null)
|
||||
{
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
var kontakt = (AktuellerKontakt) AktChatUserList?.Items[0];
|
||||
|
||||
if (kontakt.CustomerOid == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return kontakt;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return kontakt?.CustomerOid == null ? null : kontakt;
|
||||
}
|
||||
|
||||
public List<ChatMessage> GetSelectedMessages()
|
||||
{
|
||||
List<ChatMessage> itemListe = new List<ChatMessage>();
|
||||
var itemListe = new List<ChatMessage>();
|
||||
|
||||
foreach (Object selecteditem in ChatListBox.SelectedItems)
|
||||
foreach (var selectedItem in ChatListBox.SelectedItems)
|
||||
{
|
||||
ChatMessage Item = selecteditem as ChatMessage;
|
||||
var Item = selectedItem as ChatMessage;
|
||||
|
||||
//if (Item.MessagePersonOid == 0)
|
||||
//{
|
||||
itemListe.Add(Item);
|
||||
//}
|
||||
itemListe.Add(Item);
|
||||
}
|
||||
|
||||
if(itemListe.Count > 0) {
|
||||
|
||||
return itemListe;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return itemListe.Count > 0 ? itemListe : null;
|
||||
}
|
||||
|
||||
#region Style setter für ownChatDesktop Version
|
||||
public void SetzteStyleAufNull()
|
||||
public void ResetStyle()
|
||||
{
|
||||
EmojiButton.Style = null;
|
||||
MediaButton.Style = null;
|
||||
ReloadGruppen.Visibility = Visibility.Visible;
|
||||
_isDesktopVersion = false;
|
||||
_IsDesktopVersion = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Lade KontaktDaten und Lade sie in den Chat
|
||||
private void AktChatUser_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
_chat.ShowKontaktPicture(_aktuellerKontakt);
|
||||
_Chat.ShowKontaktPicture(_AktuellerKontakt);
|
||||
}
|
||||
|
||||
private void Clientlist_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if(Clientlist.SelectedItem != null)
|
||||
{
|
||||
// StartWaiting();
|
||||
disableKontaktNachrichtenThread = true;
|
||||
Cursor = Cursors.Wait;
|
||||
scrollPrueferAktivieren = false;
|
||||
_ScrollPrueferAktivieren = false;
|
||||
ChatListBox.ItemsSource = null;
|
||||
|
||||
AktChatUserList.Items.Clear();
|
||||
@@ -171,38 +135,28 @@ namespace ChatController
|
||||
var aktuellerKontakt = new AktuellerKontakt(kontakt);
|
||||
|
||||
AktChatUserList.Items.Add(aktuellerKontakt);
|
||||
_aktuellerKontakt = aktuellerKontakt;
|
||||
_AktuellerKontakt = aktuellerKontakt;
|
||||
|
||||
var x = _chat.LadeChatNachrichtenVomKontakt(aktuellerKontakt);
|
||||
var chatMessages = _Chat.LadeChatNachrichtenVomKontakt(aktuellerKontakt);
|
||||
|
||||
ChatListBox.ItemsSource = x;
|
||||
|
||||
//ChatListBox.Items.MoveCurrentToLast();
|
||||
//ChatListBox.ScrollIntoView(ChatListBox.Items.CurrentItem);
|
||||
ChatListBox.ItemsSource = chatMessages;
|
||||
|
||||
if (VisualTreeHelper.GetChildrenCount(ChatListBox) > 0)
|
||||
{
|
||||
Border border = (Border)VisualTreeHelper.GetChild(ChatListBox, 0);
|
||||
ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
|
||||
var border = (Border) VisualTreeHelper.GetChild(ChatListBox, 0);
|
||||
var scrollViewer = (ScrollViewer) VisualTreeHelper.GetChild(border, 0);
|
||||
scrollViewer.ScrollToBottom();
|
||||
}
|
||||
|
||||
//if (ChatListBox.Items.Count > 0)
|
||||
//{
|
||||
// ChatListBox.SelectedIndex = ChatListBox.Items.Count - 1;
|
||||
// ChatListBox.ScrollIntoView(ChatListBox.SelectedItem);
|
||||
//}
|
||||
|
||||
ChatListBox.ContextMenu = _chat.ErstelleKontextMenue();
|
||||
ChatListBox.ContextMenu = _Chat.ErstelleKontextMenue();
|
||||
SetContextHandler();
|
||||
scrollPrueferAktivieren = true;
|
||||
_ScrollPrueferAktivieren = true;
|
||||
|
||||
HorcheAktivNachNachrichten();
|
||||
Cursor = Cursors.Arrow;
|
||||
|
||||
|
||||
disableKontaktNachrichtenThread = false;
|
||||
// EndWaiting();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -213,9 +167,9 @@ namespace ChatController
|
||||
{
|
||||
var contextItems = ChatListBox.ContextMenu.Items;
|
||||
|
||||
foreach (var menuItemText in menuItemName2Callback.Keys)
|
||||
foreach (var menuItemText in _MenuItemName2Callback.Keys)
|
||||
{
|
||||
var cb = menuItemName2Callback[menuItemText];
|
||||
var cb = _MenuItemName2Callback[menuItemText];
|
||||
|
||||
MenuItem item = new MenuItem();
|
||||
|
||||
@@ -249,14 +203,14 @@ namespace ChatController
|
||||
{
|
||||
var item = (ChatMessage)items;
|
||||
|
||||
_chat.SpeichernUnterFunkion(item);
|
||||
_Chat.SpeichernUnterFunkion(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void Item3OnClick(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
_chat.Einfuegen(kontakt.GroupId,this);
|
||||
_Chat.Einfuegen(kontakt.GroupId,this);
|
||||
}
|
||||
|
||||
private void Item4OnClick(object sender, RoutedEventArgs routedEventArgs)
|
||||
@@ -270,7 +224,7 @@ namespace ChatController
|
||||
}
|
||||
|
||||
if(!chatmessages.Equals(""))
|
||||
_chat.Kopieren(chatmessages, 1);
|
||||
_Chat.Kopieren(chatmessages, 1);
|
||||
}
|
||||
|
||||
private void Chat_OnContextMenuOpening(object sender, ContextMenuEventArgs e)
|
||||
@@ -374,9 +328,9 @@ namespace ChatController
|
||||
|
||||
public void AddContextMenu(string menuItemText, Action<string> callBackAction)
|
||||
{
|
||||
if (!menuItemName2Callback.ContainsKey(menuItemText))
|
||||
if (!_MenuItemName2Callback.ContainsKey(menuItemText))
|
||||
{
|
||||
menuItemName2Callback.Add(menuItemText, callBackAction);
|
||||
_MenuItemName2Callback.Add(menuItemText, callBackAction);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -388,21 +342,21 @@ namespace ChatController
|
||||
{
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
|
||||
var medium = _chat.HoleMedium();
|
||||
var medium = _Chat.HoleMedium();
|
||||
|
||||
if(medium != null) {
|
||||
|
||||
string convertetMedia = _chat.ScaleImage(medium, Path.GetExtension(medium.ToUpperInvariant()));
|
||||
string convertetMedia = _Chat.ScaleImage(medium, Path.GetExtension(medium.ToUpperInvariant()));
|
||||
|
||||
if (!convertetMedia.Equals(""))
|
||||
{
|
||||
_chat.AddeMediumDerNachrichtView(convertetMedia,medium);
|
||||
_Chat.AddeMediumDerNachrichtView(convertetMedia,medium);
|
||||
|
||||
CollectionViewSource.GetDefaultView(ChatListBox.ItemsSource).Refresh();
|
||||
ChatListBox.Items.MoveCurrentToLast();
|
||||
ChatListBox.ScrollIntoView(ChatListBox.Items.CurrentItem);
|
||||
|
||||
_chat.SendeMediumAnKontakt(kontakt, convertetMedia,medium);
|
||||
_Chat.SendeMediumAnKontakt(kontakt, convertetMedia,medium);
|
||||
|
||||
if (!convertetMedia.Equals("") && !convertetMedia.Equals(medium) && File.Exists(convertetMedia))
|
||||
{
|
||||
@@ -425,20 +379,20 @@ namespace ChatController
|
||||
#region Sende Normale Nachrichten
|
||||
private void SendButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!AktChatUserList.Items.IsEmpty && !Chatbox.Text.Equals("") && isChatBoxOnFocus)
|
||||
if (!AktChatUserList.Items.IsEmpty && !Chatbox.Text.Equals("") && _IsChatBoxOnFocus)
|
||||
{
|
||||
if (!Chatbox.Text.Equals(""))
|
||||
{
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
|
||||
_chat.AddeNachrichtDerView(Chatbox.Text);
|
||||
_Chat.AddeNachrichtDerView(Chatbox.Text);
|
||||
|
||||
CollectionViewSource.GetDefaultView(ChatListBox.ItemsSource).Refresh();
|
||||
|
||||
ChatListBox.Items.MoveCurrentToLast();
|
||||
ChatListBox.ScrollIntoView(ChatListBox.Items.CurrentItem);
|
||||
|
||||
_chat.SendMessage(Chatbox.Text, kontakt.GroupId);
|
||||
_Chat.SendMessage(Chatbox.Text, kontakt.GroupId);
|
||||
|
||||
Chatbox.Text = "";
|
||||
|
||||
@@ -446,7 +400,7 @@ namespace ChatController
|
||||
{
|
||||
Chatbox.Text = "Nachricht schreiben";
|
||||
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
|
||||
isChatBoxOnFocus = false;
|
||||
_IsChatBoxOnFocus = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -459,7 +413,7 @@ namespace ChatController
|
||||
{
|
||||
Chatbox.Text = "Nachricht schreiben";
|
||||
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
|
||||
isChatBoxOnFocus = false;
|
||||
_IsChatBoxOnFocus = false;
|
||||
}
|
||||
}
|
||||
else if (Chatbox.Text.Equals(""))
|
||||
@@ -469,7 +423,7 @@ namespace ChatController
|
||||
{
|
||||
Chatbox.Text = "Nachricht schreiben";
|
||||
Chatbox.Foreground = new SolidColorBrush(Colors.DarkGray);
|
||||
isChatBoxOnFocus = false;
|
||||
_IsChatBoxOnFocus = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,7 +435,7 @@ namespace ChatController
|
||||
{
|
||||
Chatbox.Text = "";
|
||||
Chatbox.Foreground = new SolidColorBrush(Colors.Black);
|
||||
isChatBoxOnFocus = true;
|
||||
_IsChatBoxOnFocus = true;
|
||||
}
|
||||
|
||||
//hier bereich wie Dokumentieren
|
||||
@@ -497,13 +451,13 @@ namespace ChatController
|
||||
{
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
|
||||
_chat.AddeNachrichtDerView(Chatbox.Text);
|
||||
_Chat.AddeNachrichtDerView(Chatbox.Text);
|
||||
|
||||
CollectionViewSource.GetDefaultView(ChatListBox.ItemsSource).Refresh();
|
||||
ChatListBox.Items.MoveCurrentToLast();
|
||||
ChatListBox.ScrollIntoView(ChatListBox.Items.CurrentItem);
|
||||
|
||||
_chat.SendMessage(Chatbox.Text, kontakt.GroupId);
|
||||
_Chat.SendMessage(Chatbox.Text, kontakt.GroupId);
|
||||
|
||||
|
||||
Chatbox.Text = "";
|
||||
@@ -554,7 +508,7 @@ namespace ChatController
|
||||
if (scrollBar.Orientation == Orientation.Horizontal)
|
||||
{
|
||||
scrollBar.ValueChanged += HorizontalScrollbarChanged;
|
||||
scrollPrueferAktivieren = true;
|
||||
_ScrollPrueferAktivieren = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -565,7 +519,7 @@ namespace ChatController
|
||||
|
||||
private void VerticalScrollbarChanged(object sender, RoutedPropertyChangedEventArgs<double> routedPropertyChangedEventArgs)
|
||||
{
|
||||
if (scrollPrueferAktivieren == true)
|
||||
if (_ScrollPrueferAktivieren == true)
|
||||
{
|
||||
var x = (ScrollBar) sender;
|
||||
|
||||
@@ -577,7 +531,7 @@ namespace ChatController
|
||||
{
|
||||
Cursor = Cursors.Wait;
|
||||
//StartWaiting();
|
||||
scrollPrueferAktivieren = false;
|
||||
_ScrollPrueferAktivieren = false;
|
||||
|
||||
ChatListBox.Items.MoveCurrentToFirst();
|
||||
ChatMessage item = ChatListBox.Items.CurrentItem as ChatMessage;
|
||||
@@ -586,7 +540,7 @@ namespace ChatController
|
||||
|
||||
var kontakt = (KontaktlistBuilder)Clientlist.SelectedItem;
|
||||
|
||||
var xy = _chat.LadeWeiterNachrichten(kontakt);
|
||||
var xy = _Chat.LadeWeiterNachrichten(kontakt);
|
||||
|
||||
ChatListBox.ItemsSource = xy;
|
||||
|
||||
@@ -636,18 +590,18 @@ namespace ChatController
|
||||
|
||||
private void HorcheAktivNachNachrichten()
|
||||
{
|
||||
if (newThread != null)
|
||||
if (_NewThread != null)
|
||||
{
|
||||
newThread.Join();
|
||||
newThread = null;
|
||||
_NewThread.Join();
|
||||
_NewThread = null;
|
||||
}
|
||||
|
||||
var kontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
|
||||
//thred besser verwalten
|
||||
newThread = new Thread(DoWork);
|
||||
newThread.IsBackground = true;
|
||||
newThread.Start(kontakt);
|
||||
_NewThread = new Thread(DoWork);
|
||||
_NewThread.IsBackground = true;
|
||||
_NewThread.Start(kontakt);
|
||||
|
||||
}
|
||||
|
||||
@@ -662,7 +616,7 @@ namespace ChatController
|
||||
|
||||
if (!disableKontaktNachrichtenThread)
|
||||
{
|
||||
_schaueNachMs = _chat.SchaueNachNeuenNachrichten(kontakt);
|
||||
_schaueNachMs = _Chat.SchaueNachNeuenNachrichten(kontakt);
|
||||
|
||||
if (_schaueNachMs == true)
|
||||
{
|
||||
@@ -674,7 +628,7 @@ namespace ChatController
|
||||
if (kontakt != null)
|
||||
{
|
||||
|
||||
var x = _chat.LadeChatNachrichtenVomKontakt(kontakt);
|
||||
var x = _Chat.LadeChatNachrichtenVomKontakt(kontakt);
|
||||
|
||||
CollectionViewSource.GetDefaultView(ChatListBox.ItemsSource).Refresh();
|
||||
|
||||
@@ -700,16 +654,16 @@ namespace ChatController
|
||||
#region Für alle Nachrichten Count Listener
|
||||
private void HorcheAlleGruppenNachrichten()
|
||||
{
|
||||
AlleKontakteThread = new Thread(DoWorkAlleNachrichten);
|
||||
AlleKontakteThread.IsBackground = true;
|
||||
AlleKontakteThread.Start();
|
||||
_AlleKontakteThread = new Thread(DoWorkAlleNachrichten);
|
||||
_AlleKontakteThread.IsBackground = true;
|
||||
_AlleKontakteThread.Start();
|
||||
}
|
||||
|
||||
private void DoWorkAlleNachrichten()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var x = _chat.SchaueNachAllenMessageCounts();
|
||||
var x = _Chat.SchaueNachAllenMessageCounts();
|
||||
|
||||
if (x > 0)
|
||||
{
|
||||
@@ -717,7 +671,7 @@ namespace ChatController
|
||||
DispatcherPriority.Background,
|
||||
(Action)delegate
|
||||
{
|
||||
var alist = _chat.NeueGroupklassenKontakte();
|
||||
var alist = _Chat.NeueGroupklassenKontakte();
|
||||
|
||||
AktuellerKontakt aktuellerKontakt = null;
|
||||
|
||||
@@ -726,7 +680,7 @@ namespace ChatController
|
||||
aktuellerKontakt = (AktuellerKontakt)AktChatUserList.Items[0];
|
||||
}
|
||||
|
||||
foreach (var liste in _kontaktlist)
|
||||
foreach (var liste in _ContactList)
|
||||
{
|
||||
foreach (var neu in alist)
|
||||
{
|
||||
@@ -749,16 +703,16 @@ namespace ChatController
|
||||
}
|
||||
|
||||
//abchecken ob neue Groupid in liste vorhanden , wenn nicht dann adde neuen kontakt der liste hinzu
|
||||
if (!_kontaktlist.Contains(neu))
|
||||
if (!_ContactList.Contains(neu))
|
||||
{
|
||||
_kontaktlist.ToList().Add(neu);
|
||||
_ContactList.ToList().Add(neu);
|
||||
}
|
||||
}
|
||||
|
||||
//umgekert ist eine kontakt aus der liste nicht mehr in neu muss diese raus
|
||||
if (!alist.Contains(liste))
|
||||
{
|
||||
_kontaktlist.ToList().Remove(liste);
|
||||
_ContactList.ToList().Remove(liste);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,7 +723,7 @@ namespace ChatController
|
||||
|
||||
}
|
||||
|
||||
if (AlleNachrichtenThreadBool == false)
|
||||
if (_AlleNachrichtenThreadBool == false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -814,7 +768,7 @@ namespace ChatController
|
||||
if (item != null && item.ImageSources != null)
|
||||
{
|
||||
StartWaiting();
|
||||
_chat.ShowPicture(item, EndWaiting);
|
||||
_Chat.ShowPicture(item, EndWaiting);
|
||||
}
|
||||
else if(item != null && item.Dokpfad != null)
|
||||
{
|
||||
@@ -864,7 +818,7 @@ namespace ChatController
|
||||
StartWaiting();
|
||||
|
||||
string path = Path.Combine(Path.GetTempPath(), filename);
|
||||
createdTempFiles.Add(path);
|
||||
_CreatedTempFiles.Add(path);
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
using (WebClient webClient = new WebClient())
|
||||
@@ -956,11 +910,11 @@ namespace ChatController
|
||||
|
||||
SpeichereMessageInfoInDatei();
|
||||
|
||||
var aktuelleGruppen = _chat.GruppenAktuallisieren();
|
||||
var aktuelleGruppen = _Chat.GruppenAktuallisieren();
|
||||
|
||||
var x = _chat.GroupklassenAktuallisieren(aktuelleGruppen);
|
||||
var x = _Chat.GroupklassenAktuallisieren(aktuelleGruppen);
|
||||
|
||||
_kontaktlist = x;
|
||||
_ContactList = x;
|
||||
|
||||
LeseMessageInfoAusDatei();
|
||||
|
||||
@@ -980,7 +934,7 @@ namespace ChatController
|
||||
public void SpeichereMessageInfoInDatei()
|
||||
{
|
||||
List<KontaktlistBuilder> aa = new List<KontaktlistBuilder>();
|
||||
foreach (var kontakt in _kontaktlist)
|
||||
foreach (var kontakt in _ContactList)
|
||||
{
|
||||
if(kontakt.SetzeGelesen == 0 && !kontakt.ReceiveMs.Equals("")) {
|
||||
aa.Add(kontakt);
|
||||
@@ -988,21 +942,21 @@ namespace ChatController
|
||||
}
|
||||
|
||||
if(aa.Count>0)
|
||||
_chat.SpeichereTimeStampsInDatei(aa);
|
||||
_Chat.SpeichereTimeStampsInDatei(aa);
|
||||
}
|
||||
|
||||
public void LeseMessageInfoAusDatei()
|
||||
{
|
||||
List<KontaktlistBuilder> aa = new List<KontaktlistBuilder>();
|
||||
foreach (var kontakt in _kontaktlist)
|
||||
foreach (var kontakt in _ContactList)
|
||||
{
|
||||
aa.Add(kontakt);
|
||||
}
|
||||
|
||||
var liste = _chat.PruefeTimeStampsBeiStart(aa);
|
||||
var liste = _Chat.PruefeTimeStampsBeiStart(aa);
|
||||
|
||||
if(liste != null) {
|
||||
foreach (var kon in _kontaktlist)
|
||||
foreach (var kon in _ContactList)
|
||||
{
|
||||
foreach (var item in liste)
|
||||
{
|
||||
@@ -1041,7 +995,7 @@ namespace ChatController
|
||||
{
|
||||
if (liste != null)
|
||||
{
|
||||
foreach (var kon in _kontaktlist)
|
||||
foreach (var kon in _ContactList)
|
||||
{
|
||||
foreach (var item in liste)
|
||||
{
|
||||
@@ -1058,7 +1012,7 @@ namespace ChatController
|
||||
|
||||
public void DeleteTempFiles()
|
||||
{
|
||||
foreach (var file in createdTempFiles)
|
||||
foreach (var file in _CreatedTempFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user