tr
This commit is contained in:
@@ -1,51 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
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.Shapes;
|
||||
using System.Windows.Threading;
|
||||
|
||||
using ChatController;
|
||||
using ChatController.HauptKlassen;
|
||||
|
||||
namespace ownChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ChatEmojisView.xaml
|
||||
/// </summary>
|
||||
public partial class ChatEmojisView
|
||||
{
|
||||
|
||||
private ChatEmoji _emojii;
|
||||
|
||||
public ChatEmojisView(ChatMainControl chatMainControler)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
cem.InitChatView(chatMainControler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void ChatEmojisView_OnFocusableChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (ChatEmojiView.Visibility == Visibility.Visible)
|
||||
{
|
||||
ChatEmojiView.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ownChat" Icon="pack://application:,,,/ChatController;component/Ressourcen/ownchat_icon.png"
|
||||
Icon="pack://application:,,,/ChatController;component/Ressourcen/ownchat_icon.png"
|
||||
xmlns:cc="clr-namespace:ChatController;assembly=ChatController"
|
||||
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterScreen" ResizeMode="NoResize"
|
||||
Title="ownChat Desktop" Height="500" Width="700" >
|
||||
<Grid>
|
||||
<cc:LoginControl OnLogin="LoginControl_OnOnLogin"></cc:LoginControl>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -1,45 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
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.Shapes;
|
||||
using ChatController.HauptKlassen;
|
||||
using ChatController.Klassen;
|
||||
using ChatController.Klassen;
|
||||
|
||||
namespace ownChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für LoginMaske.xaml
|
||||
/// </summary>
|
||||
public partial class LoginMaske : Window
|
||||
public partial class LoginMaske
|
||||
{
|
||||
|
||||
public LoginMaske()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.Title = "ownChat Desktop";
|
||||
Title = "ownChat Desktop";
|
||||
}
|
||||
|
||||
|
||||
private void LoginControl_OnOnLogin(ChatDatenUebergabe cdu)
|
||||
{
|
||||
MainWindow window = new MainWindow(cdu);
|
||||
window.Show();
|
||||
var mainWindow = new MainWindow(cdu);
|
||||
mainWindow.Show();
|
||||
Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:ownChat"
|
||||
xmlns:cc="clr-namespace:ChatController;assembly=ChatController"
|
||||
mc:Ignorable="d" WindowStartupLocation="CenterScreen" Icon="pack://application:,,,/ChatController;component/Ressourcen/ownchat_icon.png"
|
||||
Title="ownChat Desktop" Height="700" Width="900" x:Name="MainView" Closed="MainWindow_OnClosed">
|
||||
|
||||
@@ -1,133 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
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.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
using ChatController;
|
||||
using ChatController.ChatKlassen;
|
||||
using ChatController.HauptKlassen;
|
||||
using ChatController.Klassen;
|
||||
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
using Button = System.Windows.Forms.Button;
|
||||
using ContextMenu = System.Windows.Controls.ContextMenu;
|
||||
using Image = System.Windows.Controls.Image;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
using MenuItem = System.Windows.Controls.MenuItem;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using Path = System.IO.Path;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
|
||||
namespace ownChat
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
public partial class MainWindow
|
||||
{
|
||||
private readonly Chat _chat;
|
||||
private AktuellerKontakt _aktuellerKontakt;
|
||||
|
||||
private bool isChatBoxOnFocus = false;
|
||||
|
||||
private ChatEmojisView _emojiView;
|
||||
|
||||
private IOrderedEnumerable<ChatMessage> _Orderedmessagelist;
|
||||
private IOrderedEnumerable<KontaktlistBuilder> _kontaktlist;
|
||||
|
||||
private readonly List<ChatMessage> _messagelist = new List<ChatMessage>();
|
||||
private Thread _sendt;
|
||||
private Thread _erhaltent;
|
||||
private readonly ChatEmojisView _EmojiView;
|
||||
|
||||
public MainWindow(ChatDatenUebergabe x)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
ChatMainControl.InitMitChatdaten(x);
|
||||
ChatMainControl.SetzteStyleAufNull();
|
||||
//ChatMainControl.AddContextMenu("In Dokumentation übernehmen", ChatMainControl_OnClickContextMenuItem);
|
||||
|
||||
ChatMainControl.ResetStyle();
|
||||
|
||||
_EmojiView = new ChatEmojisView(ChatMainControl);
|
||||
}
|
||||
|
||||
private void ChatMainControl_OnOnEmojii(System.Windows.Controls.Button emojiButton)
|
||||
{
|
||||
if (_emojiView == null) {
|
||||
_emojiView = new ChatEmojisView(ChatMainControl);
|
||||
_EmojiView.Visibility = Visibility.Visible;
|
||||
|
||||
var x = emojiButton.PointToScreen(new Point(0, 0));
|
||||
PresentationSource source = PresentationSource.FromVisual(emojiButton);
|
||||
var pointToScreen = emojiButton.PointToScreen(new Point(0, 0));
|
||||
var presentationSource = PresentationSource.FromVisual(emojiButton);
|
||||
|
||||
_emojiView.Top = (x.Y / source.CompositionTarget.TransformToDevice.M22) - _emojiView.Height - 5; //- 5
|
||||
_emojiView.Left = (x.X / source.CompositionTarget.TransformToDevice.M11) - 270; //x.X / source.CompositionTarget.TransformToDevice.M11
|
||||
|
||||
|
||||
_emojiView.Show();
|
||||
}
|
||||
else
|
||||
if(presentationSource?.CompositionTarget != null)
|
||||
{
|
||||
if (_emojiView.Visibility == Visibility.Visible)
|
||||
{
|
||||
_emojiView.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
_emojiView.Visibility = Visibility.Visible;
|
||||
|
||||
var x = emojiButton.PointToScreen(new Point(0, 0));
|
||||
PresentationSource source = PresentationSource.FromVisual(emojiButton);
|
||||
|
||||
_emojiView.Top = (x.Y / source.CompositionTarget.TransformToDevice.M22) - _emojiView.Height - 5; //- 5
|
||||
_emojiView.Left = (x.X / source.CompositionTarget.TransformToDevice.M11) - 270; //x.X / source.CompositionTarget.TransformToDevice.M11
|
||||
}
|
||||
_EmojiView.Top = pointToScreen.Y / presentationSource.CompositionTarget.TransformToDevice.M22 - _EmojiView.Height - 5;
|
||||
_EmojiView.Left = pointToScreen.X / presentationSource.CompositionTarget.TransformToDevice.M11 - 270;
|
||||
}
|
||||
}
|
||||
|
||||
private void MainWindow_OnClosed(object sender, EventArgs e)
|
||||
{
|
||||
//_emojiView = null;
|
||||
//ChatMainControl.SpeichereMessageInfoInDatei();
|
||||
//// Environment.Exit(0);
|
||||
//LoginMaske newLogin = new LoginMaske();
|
||||
//newLogin.Show();
|
||||
|
||||
ChatMainControl.SpeichereMessageInfoInDatei();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void ChatMainControl_OnOnClose()
|
||||
{
|
||||
//this.Close();
|
||||
ChatMainControl.SpeichereMessageInfoInDatei();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user