Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
28
DokterApp/ITab.cs
Normal file
28
DokterApp/ITab.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
public interface ITab
|
||||
{
|
||||
string Name { get; set; }
|
||||
ICommand CloseCommand { get; }
|
||||
event EventHandler CloseRequested;
|
||||
}
|
||||
|
||||
public abstract class Tab : ITab
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ICommand CloseCommand { get; }
|
||||
public event EventHandler CloseRequested;
|
||||
|
||||
public Tab()
|
||||
{
|
||||
//CloseCommand =
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,25 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:DokterApp"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="800">
|
||||
<Grid>
|
||||
WindowState="Maximized"
|
||||
Title="Dokter App" >
|
||||
<Grid RenderTransformOrigin="0.499,0.49">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="23*"/>
|
||||
<RowDefinition Height="31*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.ColumnSpan="2" Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" Orientation="Vertical">
|
||||
<Label Content="Sensei" Margin="0,0,0,20" HorizontalAlignment="Center"/>
|
||||
<Label Content="Username" HorizontalContentAlignment="Center"/>
|
||||
<TextBox x:Name="Username" TextWrapping="Wrap" Width="120"/>
|
||||
<Label Content="Password" HorizontalContentAlignment="Center"/>
|
||||
<TextBox x:Name="Password" TextWrapping="Wrap" Width="120"/>
|
||||
<Button x:Name="Login" Content="Login" Margin="0,20,0,0" Click="Login_Click_1" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -24,5 +24,17 @@ namespace DokterApp
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Login_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowTabs windowTabs = new WindowTabs();
|
||||
windowTabs.Show();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
67
DokterApp/UserControlForTab.xaml
Normal file
67
DokterApp/UserControlForTab.xaml
Normal file
@@ -0,0 +1,67 @@
|
||||
<UserControl x:Class="DokterApp.UserControlForTab"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:DokterApp"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Margin="15,5,15,15">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="43*"/>
|
||||
<RowDefinition Height="47*"/>
|
||||
<RowDefinition Height="180*"/>
|
||||
<RowDefinition Height="180*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.RowSpan="2" Margin="0,0,0,22">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="{x:Type Label}">
|
||||
<Setter Property="Margin" Value="0,0,20,0"/>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<Label Content="UserName" Name="Username_Label"/>
|
||||
<Label Content="Status: " Name="Status_Label"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,10,0,0" Grid.RowSpan="2" Grid.Row="1">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="{x:Type DockPanel}">
|
||||
<Setter Property="Margin" Value="0,20,0,0"/>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<DockPanel Height="26" LastChildFill="False" HorizontalAlignment="Stretch">
|
||||
<Label Content="Resistance" Width="110" DockPanel.Dock="Right"/>
|
||||
<Label Content="Current Speed" Width="110" DockPanel.Dock="Left"/>
|
||||
<Label Content="Current BPM" Width="110" DockPanel.Dock="Top"/>
|
||||
</DockPanel>
|
||||
<DockPanel Height="26" LastChildFill="False" HorizontalAlignment="Stretch">
|
||||
<TextBox Name="textBox_Resistance" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Right" IsReadOnly="true"/>
|
||||
<TextBox Name="textBox_CurrentSpeed" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Left" IsReadOnly="true"/>
|
||||
<TextBox Name="textBox_CurrentBPM" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Top" Height="26" IsReadOnly="true"/>
|
||||
</DockPanel>
|
||||
<DockPanel Height="26" LastChildFill="False">
|
||||
<Label Content="Distance Covered" Width="110" DockPanel.Dock="Right"/>
|
||||
<Label Content="Current Power" Width="110" DockPanel.Dock="Left"/>
|
||||
<Label Content="Acc. Power" Width="110" DockPanel.Dock="Top"/>
|
||||
</DockPanel>
|
||||
<DockPanel Height="26" LastChildFill="False">
|
||||
<TextBox Name="textBox_DistanceCovered" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Right" IsReadOnly="true"/>
|
||||
<TextBox Name="textBox_CurrentPower" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Left" IsReadOnly="true"/>
|
||||
<TextBox Name="textBox_AccPower" Text="" TextWrapping="Wrap" Width="110" DockPanel.Dock="Top" Height="26" IsReadOnly="true"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<ListBox Name="ChatBox" Grid.Column="1" Margin="59,41,0,0" SelectionChanged="ListBox_SelectionChanged" Grid.RowSpan="3"/>
|
||||
<TextBox Name="textBox_Chat" Grid.Column="1" HorizontalAlignment="Left" Margin="59,10,0,0" Grid.Row="3" Text="TextBox" TextWrapping="Wrap" VerticalAlignment="Top" Width="235"/>
|
||||
<Button Content="Button" Grid.Column="1" HorizontalAlignment="Left" Margin="59,33,0,0" Grid.Row="3" VerticalAlignment="Top" Click="Button_Click"/>
|
||||
<Button Content="Start Session" Grid.Column="1" HorizontalAlignment="Left" Margin="69,86,0,0" Grid.Row="3" VerticalAlignment="Top" Width="97" Click="StartSession_Click"/>
|
||||
<Button Content="Stop Session" Grid.Column="1" HorizontalAlignment="Left" Margin="187,86,0,0" Grid.Row="3" VerticalAlignment="Top" Width="97" Click="StopSession_Click"/>
|
||||
<TextBox x:Name="textBox_SetResistance" Grid.Column="1" HorizontalAlignment="Left" Margin="69,128,0,0" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Top" Width="97"/>
|
||||
<Button Content="Set Resistance" Grid.Column="1" HorizontalAlignment="Left" Margin="187,128,0,0" Grid.Row="3" VerticalAlignment="Top" Width="97" Height="18" Click="SetResistance_Click"/>
|
||||
<Canvas Grid.Row="3" Background="White" Margin="0,33,0,0"/>
|
||||
<ComboBox Name="DropBox" HorizontalAlignment="Left" Margin="0,6,0,0" Grid.Row="3" VerticalAlignment="Top" Width="190"/>
|
||||
<Button Content="Client Info" Grid.Column="1" HorizontalAlignment="Left" Margin="207,6,0,0" VerticalAlignment="Top" Height="26" Width="82" Click="ClientInfo_Click"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
59
DokterApp/UserControlForTab.xaml.cs
Normal file
59
DokterApp/UserControlForTab.xaml.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
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;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for UserControlForTab.xaml
|
||||
/// </summary>
|
||||
public partial class UserControlForTab : UserControl
|
||||
{
|
||||
public UserControlForTab()
|
||||
{
|
||||
InitializeComponent();
|
||||
Username_Label.Content = "Bob";
|
||||
Status_Label.Content = "Status: Dead";
|
||||
}
|
||||
|
||||
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ChatBox.Items.Add(textBox_Chat.Text);
|
||||
}
|
||||
|
||||
private void StartSession_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void StopSession_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void SetResistance_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ClientInfo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("firstname:\tBob\n" +
|
||||
"surname:\t\tde Bouwer");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
14
DokterApp/UserTab.cs
Normal file
14
DokterApp/UserTab.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
class UserTab : Tab
|
||||
{
|
||||
public UserTab()
|
||||
{
|
||||
Name = "Piet";
|
||||
}
|
||||
}
|
||||
}
|
||||
16
DokterApp/WindowTabs.xaml
Normal file
16
DokterApp/WindowTabs.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="DokterApp.WindowTabs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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:DokterApp"
|
||||
mc:Ignorable="d"
|
||||
WindowState="Maximized"
|
||||
Title="WindowTabs" Height="450" Width="800">
|
||||
<Grid>
|
||||
<TabControl x:Name="tabControl" Loaded="tabControl_Load" TabStripPlacement="Left" Margin="0,23,0,0" />
|
||||
<Button Content="Button" HorizontalAlignment="Left" Margin="578,125,0,0" VerticalAlignment="Top" Click="Button_Click"/>
|
||||
<Button Content="Button" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
44
DokterApp/WindowTabs.xaml.cs
Normal file
44
DokterApp/WindowTabs.xaml.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
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;
|
||||
|
||||
namespace DokterApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for WindowTabs.xaml
|
||||
/// </summary>
|
||||
public partial class WindowTabs : Window
|
||||
{
|
||||
public TabControl tbControl;
|
||||
public WindowTabs()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void tabControl_Load(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.tbControl = (sender as TabControl);
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
TabItem newTabItem = new TabItem
|
||||
{
|
||||
Header = "Test",
|
||||
Width = 110,
|
||||
Height = 40
|
||||
};
|
||||
newTabItem.Content = new UserControlForTab();
|
||||
this.tbControl.Items.Add(newTabItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ namespace Server
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// handles all incoming data from the client
|
||||
/// </summary>
|
||||
/// <param name="message">including message length and messageId (can be changed)</param>
|
||||
private void HandleData(byte[] message)
|
||||
@@ -216,10 +216,6 @@ namespace Server
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static string ByteArrayToString(byte[] ba)
|
||||
{
|
||||
StringBuilder hex = new StringBuilder(ba.Length * 2);
|
||||
|
||||
Reference in New Issue
Block a user