Commit 6efdc3db authored by 潘栩锋's avatar 潘栩锋 🚴

修改全部字体为 Arial

parent 3d8e7538
......@@ -61,7 +61,7 @@
<Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" />
</Style>
......@@ -71,7 +71,7 @@
<Setter Property="Foreground" Value="#FF3B3B3B" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="MinWidth" Value="30" />
</Style>
......@@ -80,7 +80,7 @@
<Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm_interval">
<Setter Property="Foreground" Value="#FF888888" />
<Setter Property="FontSize" Value="36" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>
......@@ -89,7 +89,7 @@
<Style TargetType="TextBlock" x:Key="TextBlockStyle_FieldContent_mm">
<Setter Property="Foreground" Value="#FF888888" />
<Setter Property="FontSize" Value="22" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Bottom" />
</Style>
......
......@@ -18,7 +18,7 @@
<SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_abc">
<Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
</Style>
<Style TargetType="Button" x:Key="ButtonStyle_key">
<Setter Property="Margin" Value="3"/>
......
......@@ -13,7 +13,7 @@
<SolidColorBrush x:Key="Color_dark" Color="#8e9aa8"/>
<Style TargetType="TextBlock" x:Key="TextBlockStyle_abc">
<Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
<Setter Property="FontFamily" Value="Arial" />
</Style>
<Style TargetType="Button" x:Key="ButtonStyle_key">
<Setter Property="Margin" Value="3"/>
......
......@@ -39,9 +39,14 @@ namespace FObjBase
public virtual int SendPacket(byte[] buffer)
{
int len = buffer.Length;
out_buffer.AddRange(buffer);
return len;
lock (out_buffer)
{
int len = buffer.Length;
out_buffer.AddRange(buffer);
return len;
}
}
protected virtual int GetRecvInfoPacket() // return length of the packet
......@@ -123,35 +128,37 @@ namespace FObjBase
}
int Send_Poll()
{
int cnt_total = 0;
if (out_buffer.Count() == 0)//没数据,直接返回
return 0;
while (out_buffer.Count() > 0)//只有有数据发送,且能发送,没有 block, 就会一直循环
{
int cnt;
try
lock (out_buffer) {
int cnt_total = 0;
while (out_buffer.Count() > 0)//只有有数据发送,且能发送,没有 block, 就会一直循环
{
cnt = sock.Send(out_buffer.ToArray());
}
catch (System.Net.Sockets.SocketException e)
{
if (e.SocketErrorCode == SocketError.WouldBlock)//当前发不了,退出循环,等下次!!!!
break;
return -1;//异常,断开连接!!!
}
int cnt;
try
{
cnt = sock.Send(out_buffer.ToArray());
}
catch (System.Net.Sockets.SocketException e)
{
if (e.SocketErrorCode == SocketError.WouldBlock)//当前发不了,退出循环,等下次!!!!
break;
return -1;//异常,断开连接!!!
}
if (cnt > 0)
{
out_buffer.RemoveRange(0, cnt);//发送成功,删除!!!
cnt_total+=cnt;
}
else
{
break;
if (cnt > 0)
{
out_buffer.RemoveRange(0, cnt);//发送成功,删除!!!
cnt_total+=cnt;
}
else
{
break;
}
}
return cnt_total;//返回总发送量
}
return cnt_total;//返回总发送量
}
int Receive_Poll()
......@@ -269,7 +276,10 @@ namespace FObjBase
logger.Error("TCPConn OnPoll 连接断开,清空接收缓存区");
in_buffer.Clear();
out_buffer.Clear();
lock(out_buffer)
{
out_buffer.Clear();
}
Enable = false;
}
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment