From dec6411b592fd88fb9151555b995d016431b809d Mon Sep 17 00:00:00 2001 From: Waldi Date: Wed, 30 Nov 2016 13:58:43 +0100 Subject: [PATCH] mini update --- BeWo/View/ChatView.xaml.cs | 49 ++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/BeWo/View/ChatView.xaml.cs b/BeWo/View/ChatView.xaml.cs index 3e68a799a..6b73327b8 100644 --- a/BeWo/View/ChatView.xaml.cs +++ b/BeWo/View/ChatView.xaml.cs @@ -631,7 +631,7 @@ namespace BeWo.View view = (CollectionView)CollectionViewSource.GetDefaultView(Clientlist.ItemsSource); view.SortDescriptions.Add(new SortDescription("Receivems", ListSortDirection.Descending)); - view.SortDescriptions.Add(new SortDescription("StatusType", ListSortDirection.Descending)); + // view.SortDescriptions.Add(new SortDescription("StatusType", ListSortDirection.Descending)); view.Filter = UserFilter; if (sortLabelSwitch == true) @@ -865,22 +865,33 @@ namespace BeWo.View string imgFileString = files; - - byte[] data; - using (WebClient client = new WebClient()) + try { - data = client.DownloadData(imgFileString); + byte[] data; + using (WebClient client = new WebClient()) + { + data = client.DownloadData(imgFileString); + } + + string filename = Path.GetFileName(imgFileString); + + string isloaded = LoadDokumentFromInet(data, filename); + + if (!isloaded.IsNullOrEmpty() && isAnImage(isloaded)) + { + ZeigeProgressWärendUpload(1, isloaded); + } + else + { + ZeigeProgressWärendUpload(2, isloaded); + } + + System.Windows.Forms.Clipboard.Clear(); } - - string filename = Path.GetFileName(imgFileString); - - string isloaded = LoadDokumentFromInet(data, filename); - - if(!isloaded.IsNullOrEmpty()){ - ZeigeProgressWärendUpload(1, isloaded); + catch (Exception s) + { + MessageBox.Show("Der Chat kann den Zwischen-Speicher nicht verarbeiten.", "Fehler", MessageBoxButton.OK); } - - System.Windows.Forms.Clipboard.Clear(); } else { @@ -896,10 +907,14 @@ namespace BeWo.View string isloaded = LoadDokumentFromInet(data, bildname); - if (!isloaded.IsNullOrEmpty()) + if (!isloaded.IsNullOrEmpty() && isAnImage(isloaded)) { ZeigeProgressWärendUpload(1, isloaded); } + else + { + ZeigeProgressWärendUpload(2, isloaded); + } System.Windows.Forms.Clipboard.Clear(); } @@ -2191,6 +2206,10 @@ namespace BeWo.View () => this.Dispatch( delegate { + if (form1 != null) + { + form1.Close(); + } progressView.Close(); upload.Dispose(); }));