修复winform客户端在线账户显示的滚动条BUG,v1.6.10
This commit is contained in:
@@ -63,17 +63,18 @@ namespace ClientsLibrary.BasicSupport
|
|||||||
|
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
{
|
{
|
||||||
|
int offect = MyControls[index].Height + 4;
|
||||||
|
Location_Y -= offect;
|
||||||
MyControls[index].Dispose();
|
MyControls[index].Dispose();
|
||||||
MyControls.RemoveAt(index);
|
MyControls.RemoveAt(index);
|
||||||
|
|
||||||
// 重新计算偏移
|
// 重新计算偏移
|
||||||
|
|
||||||
Location_Y = 0 - VerticalScroll.Value;
|
for (int i = index; i < MyControls.Count; i++)
|
||||||
for (int i = 0; i < MyControls.Count; i++)
|
|
||||||
{
|
{
|
||||||
MyControls[i].Location = new Point(2, Location_Y);
|
MyControls[i].Location = new Point(2, MyControls[i].Location.Y - offect);
|
||||||
Location_Y += MyControls[i].Height + 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
label2.Text = MyControls.Count.ToString();
|
label2.Text = MyControls.Count.ToString();
|
||||||
@@ -85,8 +86,8 @@ namespace ClientsLibrary.BasicSupport
|
|||||||
panel1.Controls.Add(item);
|
panel1.Controls.Add(item);
|
||||||
// 添加显示
|
// 添加显示
|
||||||
item.SetNetAccount(account);
|
item.SetNetAccount(account);
|
||||||
item.Location = new Point(2, Location_Y); // 控件的位置
|
item.Location = new Point(2, Location_Y - panel1.VerticalScroll.Value); // 控件的位置
|
||||||
int width = VerticalScroll.Visible ? Width - 4 - SystemInformation.VerticalScrollBarWidth : Width - 4; // 控件的宽度
|
int width = panel1.VerticalScroll.Visible ? Width - 4 - SystemInformation.VerticalScrollBarWidth : Width - 4; // 控件的宽度
|
||||||
item.Size = new Size(width, item.Size.Height); // 控件的大小
|
item.Size = new Size(width, item.Size.Height); // 控件的大小
|
||||||
item.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; // 控件随窗口变化的样式
|
item.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; // 控件随窗口变化的样式
|
||||||
|
|
||||||
@@ -97,8 +98,6 @@ namespace ClientsLibrary.BasicSupport
|
|||||||
public void SetOnlineRender(NetAccount[] accounts)
|
public void SetOnlineRender(NetAccount[] accounts)
|
||||||
{
|
{
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//清楚缓存
|
|
||||||
ClearControls();
|
|
||||||
|
|
||||||
if (accounts != null)
|
if (accounts != null)
|
||||||
{
|
{
|
||||||
@@ -106,7 +105,6 @@ namespace ClientsLibrary.BasicSupport
|
|||||||
|
|
||||||
if (accounts.Length > 0 && Width > 20)
|
if (accounts.Length > 0 && Width > 20)
|
||||||
{
|
{
|
||||||
int Location_Y = 0 - VerticalScroll.Value;
|
|
||||||
//添加子控件
|
//添加子控件
|
||||||
foreach (var m in accounts)
|
foreach (var m in accounts)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace ClientsLibrary
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 本软件的当前版本,用来验证更新的关键依据
|
/// 本软件的当前版本,用来验证更新的关键依据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static SystemVersion CurrentVersion { get; } = new SystemVersion("1.0.0.171010");
|
public static SystemVersion CurrentVersion { get; } = new SystemVersion("1.0.0.171011");
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace CommonLibrary
|
|||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
SoftBasic.FrameworkVersion = new SystemVersion("1.6.9");
|
SoftBasic.FrameworkVersion = new SystemVersion("1.6.10");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -406,6 +406,7 @@ namespace 软件系统客户端Wpf
|
|||||||
|
|
||||||
private NetComplexClient net_socket_client = new NetComplexClient();
|
private NetComplexClient net_socket_client = new NetComplexClient();
|
||||||
|
|
||||||
|
|
||||||
private void Net_Socket_Client_Initialization()
|
private void Net_Socket_Client_Initialization()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -490,8 +491,6 @@ namespace 软件系统客户端Wpf
|
|||||||
TextBlock_FileCount.Text = json["FileCount"].ToObject<int>().ToString();
|
TextBlock_FileCount.Text = json["FileCount"].ToObject<int>().ToString();
|
||||||
UIControls_Chat.AddChatsHistory(sb.ToString());
|
UIControls_Chat.AddChatsHistory(sb.ToString());
|
||||||
|
|
||||||
|
|
||||||
ClientsOnline.Children.Clear();
|
|
||||||
NetAccount[] accounts = JArray.Parse(json["ClientsOnline"].ToString()).ToObject<NetAccount[]>();
|
NetAccount[] accounts = JArray.Parse(json["ClientsOnline"].ToString()).ToObject<NetAccount[]>();
|
||||||
|
|
||||||
foreach (var m in accounts)
|
foreach (var m in accounts)
|
||||||
|
|||||||
@@ -907,7 +907,7 @@ namespace 软件系统服务端模版
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
net_socket_server.KeyToken = CommonProtocol.KeyToken; // 设置身份令牌
|
net_socket_server.KeyToken = CommonProtocol.KeyToken; // 设置身份令牌
|
||||||
net_socket_server.LogNet =new LogNetSingle(LogSavePath + @"\net_log.txt");
|
net_socket_server.LogNet =new LogNetSingle(LogSavePath + @"\net_log.txt"); // 设置日志存储路径
|
||||||
net_socket_server.LogNet.SetMessageDegree(HslMessageDegree.DEBUG); // 默认debug及以上级别日志均进行存储,根据需要自行选择
|
net_socket_server.LogNet.SetMessageDegree(HslMessageDegree.DEBUG); // 默认debug及以上级别日志均进行存储,根据需要自行选择
|
||||||
net_socket_server.FormatClientOnline = "#IP:{0} Name:{1}"; // 必须为#开头,具体格式可由自身需求确定
|
net_socket_server.FormatClientOnline = "#IP:{0} Name:{1}"; // 必须为#开头,具体格式可由自身需求确定
|
||||||
net_socket_server.IsSaveLogClientLineChange = true; // 设置客户端上下线是否记录到日志
|
net_socket_server.IsSaveLogClientLineChange = true; // 设置客户端上下线是否记录到日志
|
||||||
@@ -985,6 +985,21 @@ namespace 软件系统服务端模版
|
|||||||
|
|
||||||
private void Net_socket_server_ClientOnline(AsyncStateOne object1)
|
private void Net_socket_server_ClientOnline(AsyncStateOne object1)
|
||||||
{
|
{
|
||||||
|
NetAccount account = new NetAccount
|
||||||
|
{
|
||||||
|
UserName = object1.LoginAlias,
|
||||||
|
Roles = UserServer.ServerRoles.GetRolesByUserName(object1.LoginAlias),
|
||||||
|
IpAddress = object1.IpAddress,
|
||||||
|
Alias = UserServer.ServerAccounts.GetAccountAlias(object1.LoginAlias),
|
||||||
|
Factory = UserServer.ServerAccounts.GetAccountFactory(object1.LoginAlias),
|
||||||
|
LoginTime = DateTime.Now,
|
||||||
|
UniqueId = object1.ClientUniqueID
|
||||||
|
};
|
||||||
|
|
||||||
|
net_socket_server.SendAllClients(CommonHeadCode.MultiNetHeadCode.新用户上线, JObject.FromObject(account).ToString());
|
||||||
|
|
||||||
|
|
||||||
|
AddOnlineClient(account);
|
||||||
// 上线后回发一条数据初始化信息
|
// 上线后回发一条数据初始化信息
|
||||||
JObject json = new JObject
|
JObject json = new JObject
|
||||||
{
|
{
|
||||||
@@ -997,21 +1012,6 @@ namespace 软件系统服务端模版
|
|||||||
net_socket_server.Send(object1, CommonHeadCode.MultiNetHeadCode.初始化数据, json.ToString());
|
net_socket_server.Send(object1, CommonHeadCode.MultiNetHeadCode.初始化数据, json.ToString());
|
||||||
// 触发上下线功能
|
// 触发上下线功能
|
||||||
UserInterfaceMessageRender(DateTime.Now.ToString("MM-dd HH:mm:ss ") + object1.IpAddress + ":" + object1.LoginAlias + " 上线");
|
UserInterfaceMessageRender(DateTime.Now.ToString("MM-dd HH:mm:ss ") + object1.IpAddress + ":" + object1.LoginAlias + " 上线");
|
||||||
|
|
||||||
NetAccount account = new NetAccount();
|
|
||||||
account.UserName = object1.LoginAlias;
|
|
||||||
account.Roles = UserServer.ServerRoles.GetRolesByUserName(object1.LoginAlias);
|
|
||||||
account.IpAddress = object1.IpAddress;
|
|
||||||
account.Alias = UserServer.ServerAccounts.GetAccountAlias(object1.LoginAlias);
|
|
||||||
account.Factory = UserServer.ServerAccounts.GetAccountFactory(object1.LoginAlias);
|
|
||||||
account.LoginTime = DateTime.Now;
|
|
||||||
account.UniqueId = object1.ClientUniqueID;
|
|
||||||
|
|
||||||
AddOnlineClient(account);
|
|
||||||
|
|
||||||
Thread.Sleep(100);
|
|
||||||
net_socket_server.SendAllClients(CommonHeadCode.MultiNetHeadCode.新用户上线, JObject.FromObject(account).ToString());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<NetAccount> OnlineClients = new List<NetAccount>();
|
private List<NetAccount> OnlineClients = new List<NetAccount>();
|
||||||
|
|||||||
Reference in New Issue
Block a user