<Window x:Class="TestWPF.MainWindow"
        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:TestWPF"
        mc:Ignorable="d"
        Title="MainWindow" Height="590" Width="1000">
    <Grid Margin="0,0,10,3">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*"/>
            <ColumnDefinition Width="0*"/>
            <ColumnDefinition Width="49*"/>
        </Grid.ColumnDefinitions>
        <Rectangle HorizontalAlignment="Left" Height="462" Margin="45,43,0,0" Stroke="Black" VerticalAlignment="Top" Width="443"/>
        <Rectangle HorizontalAlignment="Center" Height="462" Margin="0,43,0,0" Stroke="Black" VerticalAlignment="Top" Width="454" Grid.Column="2"/>
        <Button Content="①开始监听" HorizontalAlignment="Left" Margin="34,56,0,0" VerticalAlignment="Top" Width="108" Click="Button_Click" Height="19" Foreground="#FFE00000" Background="#FFB4B4B4" Grid.Column="2"/>
        <Label x:Name="Serverlog" HorizontalAlignment="Left" Margin="33,195,0,0" VerticalAlignment="Top" Width="435" Height="298" Content="" Background="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Column="2"/>
        <Button Content="②创建一个连接" HorizontalAlignment="Left" Margin="66,57,0,0" VerticalAlignment="Top" Width="110" Click="CreateClient" Height="19"/>
        <Button Content="⑥ShutDownSend" HorizontalAlignment="Left" Margin="66,129,0,0" VerticalAlignment="Top" Width="110" Click="Button_Click_4" Height="19"/>
        <Button Content="⑤发送一个消息" HorizontalAlignment="Left" Margin="34,105,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.346,0.389" Width="108" Click="ServerSendMSG" Height="19" Grid.Column="2"/>
        <Button Content="③TestRPC" HorizontalAlignment="Left" Margin="66,81,0,0" VerticalAlignment="Top" Width="110" Click="TestRpc" Height="19"/>
        <Label x:Name="ClientLog" HorizontalAlignment="Left" Margin="66,195,0,0" VerticalAlignment="Top" Width="411" Height="298" Background="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.CanContentScroll="True"/>
        <Label Content="连接端" HorizontalAlignment="Left" Margin="45,13,0,0" VerticalAlignment="Top" Width="173" Height="25"/>
        <Label Content="监听端" HorizontalAlignment="Left" Margin="10,12,0,0" VerticalAlignment="Top" Width="173" Height="25" Grid.Column="2"/>
        <Button Content="主动断开" HorizontalAlignment="Left" Margin="33,153,0,0" VerticalAlignment="Top" Width="109" Click="ServerDisconnect" Grid.Column="2" Height="19"/>
        <Button Content="主动断开" HorizontalAlignment="Left" Margin="66,153,0,0" VerticalAlignment="Top" Width="110" Click="ClientDisconnect" Height="19"/>
        <Button Content="④发送一个消息" HorizontalAlignment="Left" Margin="66,105,0,0" VerticalAlignment="Top" Width="110" Click="ClientSend" Height="19"/>
        <Button Content="Clear" HorizontalAlignment="Left" Margin="238,510,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.268,-0.038" Click="ClearLog" Height="42" Width="524" Grid.ColumnSpan="3"/>
        <TextBox x:Name="ListenPort" HorizontalAlignment="Center" Margin="0,58,0,0" TextWrapping="Wrap" Text="54321" VerticalAlignment="Top" Width="54" Height="18" Grid.Column="2"/>
        <TextBox x:Name="ConnectPort" HorizontalAlignment="Left" Margin="365,58,0,0" TextWrapping="Wrap" Text="54321" VerticalAlignment="Top" Width="54" Height="18"/>
        <TextBox x:Name="TargetIP" HorizontalAlignment="Left" Margin="188,57,0,0" TextWrapping="Wrap" Text="127.0.0.1" VerticalAlignment="Top" Width="172" Height="17"/>
        <Button x:Name="StopListen" Content="停止监听" HorizontalAlignment="Left" Margin="335,58,0,0" VerticalAlignment="Top" Width="109" Grid.Column="2" Height="19" Click="StopListen_Click"/>
        <Button x:Name="RPCString" Content="RPCString" HorizontalAlignment="Left" Margin="188,81,0,0" VerticalAlignment="Top" Width="104" Click="RPCString_Click"/>
        <Button x:Name="SendString" Grid.Column="2" Content="发送一个String" HorizontalAlignment="Left" Margin="34,129,0,0" VerticalAlignment="Top" Width="108" Click="SendString_Click"/>
        <Button x:Name="SendBigMessage" Content="SendBigMessage" HorizontalAlignment="Left" Margin="188,105,0,0" VerticalAlignment="Top" Width="104" Click="SendBigMessage_Click"/>
        <Button x:Name="TestTime" Content="Time" HorizontalAlignment="Left" Margin="188,129,0,0" VerticalAlignment="Top" Width="104" Click="TestTime_Click"/>
        <CheckBox x:Name="LogRecvBytes" Grid.Column="2" Content="LogRecvBytes" HorizontalAlignment="Left" Margin="34,83,0,0" VerticalAlignment="Top" Width="108" Checked="LogRecvBytes_Checked" Unchecked="LogRecvBytes_Unchecked" IsChecked="False"/>
        <Button x:Name="StopSocketSend" Content="StopSocketSend" HorizontalAlignment="Left" Margin="365,105,0,0" VerticalAlignment="Top" Width="105" Click="StopSocketSend_Click"/>
        <Button x:Name="StartSocketSend" Content="StartSocketSend" HorizontalAlignment="Left" Margin="365,80,0,0" VerticalAlignment="Top" Width="105" Click="StartSocketSend_Click"/>
        <ComboBox x:Name="Protocol" HorizontalAlignment="Left" Margin="368,15,0,0" VerticalAlignment="Top" Width="120" Text="Tcp" SelectionChanged="Protocol_SelectionChanged">
            <ComboBoxItem IsSelected="True">Tcp</ComboBoxItem>
            <ComboBoxItem>Udp</ComboBoxItem>
            <ComboBoxItem>Kcp</ComboBoxItem>
        </ComboBox>

    </Grid>
</Window>
