Skip to content

Commit 5f7e55b

Browse files
committed
代码精简优化,正式发布框架1.0.4版本
1 parent aaf9175 commit 5f7e55b

File tree

6 files changed

+82
-47
lines changed

6 files changed

+82
-47
lines changed

CommonLibrary/Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public class CommonLibrary
1111
static CommonLibrary()
1212
{
1313
//初始化模版的版本号
14-
//预计第一个正式发行的版本为1.1.0 日期为2017-05-10
15-
SoftBasic.FrameworkVersion = new SystemVersion("1.0.3");
14+
//预计第一个正式发行的版本为1.1.0 日期为2017-08-10
15+
SoftBasic.FrameworkVersion = new SystemVersion("1.0.4");
1616

1717
}
1818

Public/HslCommunication.dll

27.5 KB
Binary file not shown.

Public/HslCommunication.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

软件系统客户端模版/FormMainWindow.cs

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,26 @@
1414
using HslCommunication.BasicFramework;
1515

1616

17-
//============================================================================
18-
// 模版日期 2017-02-21
19-
// 创建人 胡少林
20-
// 版权所有 胡少林
21-
// 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈
22-
// 说明 JSON组件引用自james newton-king,遵循MIT授权协议
23-
// 说明 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
24-
//============================================================================
17+
/***************************************************************************************
18+
*
19+
* 模版日期 2017-05-20
20+
* 创建人 胡少林
21+
* 版权所有 胡少林
22+
* 授权说明 模版仅授权个人使用,如需商用,请联系hsl200909@163.com洽谈
23+
* 说明一 JSON组件引用自james newton-king,遵循MIT授权协议
24+
* 说明二 文件的图标来源于http://fileicons.chromefans.org/,感谢作者的无私分享
25+
*
26+
****************************************************************************************/
2527

28+
/***************************************************************************************
29+
*
30+
* 版本说明 最新版以github为准,由于提交更改比较频繁,需要经常查看官网地址:https://github.com/dathlin/C-S-
31+
* 注意 本代码的相关操作未作密码验证,如有需要,请自行完成
32+
* 示例 密码验证具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
33+
* 如果 遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
34+
*
35+
****************************************************************************************/
2636

27-
//============================================================================
28-
//
29-
// 注意:本代码的相关操作未作密码验证,如有需要,请自行完成
30-
// 示例:具体示例参照Form1_FormClosing(object sender, FormClosingEventArgs e)方法
31-
// 如果:遇到启动调试就退出了,请注释掉Program.cs文件中的指允许启动一个实例的代码
32-
//
33-
//============================================================================
3437

3538

3639

@@ -125,22 +128,28 @@ private void FormMainWindow_FormClosing(object sender, FormClosingEventArgs e)
125128
private void 修改密码ToolStripMenuItem_Click(object sender, EventArgs e)
126129
{
127130
//实例化一个密码修改的窗口,并指定了实现修改的具体方法,指定了密码长度
128-
FormPasswordModify fpm = new FormPasswordModify(UserClient.UserAccount.Password,
129-
p => {
130-
JObject json = new JObject();json.Add(UserAccount.UserNameText, UserClient.UserAccount.UserName);
131-
json.Add(UserAccount.PasswordText, p);
131+
using (FormPasswordModify fpm = new FormPasswordModify(UserClient.UserAccount.Password,
132+
p =>
133+
{
134+
JObject json = new JObject
135+
{
136+
{ UserAccount.UserNameText, UserClient.UserAccount.UserName },
137+
{ UserAccount.PasswordText, p }
138+
};
132139
return UserClient.Net_simplify_client.ReadFromServer(CommonHeadCode.SimplifyHeadCode.密码修改 + json.ToString()).IsSuccess;
133-
}, 6, 8);
134-
fpm.ShowDialog();
135-
fpm.Dispose();
140+
}, 6, 8))
141+
{
142+
fpm.ShowDialog();
143+
}
136144
}
137145

138146
private void 关于本软件ToolStripMenuItem_Click(object sender, EventArgs e)
139147
{
140-
FormAbout fa = new FormAbout(Resource.StringResouce.SoftName,
141-
UserClient.CurrentVersion, 2017, Resource.StringResouce.SoftCopyRight);
142-
fa.ShowDialog();
143-
fa.Dispose();
148+
using (FormAbout fa = new FormAbout(Resource.StringResouce.SoftName,
149+
UserClient.CurrentVersion, 2017, Resource.StringResouce.SoftCopyRight))
150+
{
151+
fa.ShowDialog();
152+
}
144153
}
145154

146155
private void 更新日志ToolStripMenuItem_Click(object sender, EventArgs e)
@@ -151,31 +160,35 @@ private void 更新日志ToolStripMenuItem_Click(object sender, EventArgs e)
151160
UserClient.JsonSettings.IsNewVersionRunning = false;
152161
UserClient.JsonSettings.SaveToFile();
153162
}
154-
FormUpdateLog ful = new FormUpdateLog(UserClient.HistoryVersions);
155-
ful.ShowDialog();
156-
ful.Dispose();
163+
using (FormUpdateLog ful = new FormUpdateLog(UserClient.HistoryVersions))
164+
{
165+
ful.ShowDialog();
166+
}
157167
}
158168

159169
private void 版本号说明ToolStripMenuItem_Click(object sender, EventArgs e)
160170
{
161-
FormAboutVersion fav = new FormAboutVersion(UserClient.CurrentVersion);
162-
fav.ShowDialog();
163-
fav.Dispose();
171+
using (FormAboutVersion fav = new FormAboutVersion(UserClient.CurrentVersion))
172+
{
173+
fav.ShowDialog();
174+
}
164175
}
165176

166177
private void 更改公告ToolStripMenuItem_Click(object sender, EventArgs e)
167178
{
168-
FormInputAndAction fiaa = new FormInputAndAction(str => UserClient.Net_simplify_client.ReadFromServer(
169-
CommonHeadCode.SimplifyHeadCode.更新公告 + str).IsSuccess,UserClient.Announcement);
170-
fiaa.ShowDialog();
171-
fiaa.Dispose();
179+
using (FormInputAndAction fiaa = new FormInputAndAction(str => UserClient.Net_simplify_client.ReadFromServer(
180+
CommonHeadCode.SimplifyHeadCode.更新公告 + str).IsSuccess, UserClient.Announcement))
181+
{
182+
fiaa.ShowDialog();
183+
}
172184
}
173185

174186
private void 日志查看ToolStripMenuItem_Click(object sender, EventArgs e)
175187
{
176-
FormLog flg = new FormLog();
177-
flg.ShowDialog();
178-
flg.Dispose();
188+
using (FormLog flg = new FormLog())
189+
{
190+
flg.ShowDialog();
191+
}
179192
}
180193

181194
private void 注册账号ToolStripMenuItem_Click(object sender, EventArgs e)

软件系统服务端模版/Form1.Designer.cs

Lines changed: 16 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

软件系统服务端模版/Form1.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ private void 关于软件ToolStripMenuItem_Click(object sender, EventArgs e)
179179
fm.ShowDialog();
180180
}
181181
}
182+
private void 框架作者ToolStripMenuItem_Click(object sender, EventArgs e)
183+
{
184+
using (FormAuthorAdvertisement faa = new FormAuthorAdvertisement())
185+
{
186+
faa.ShowDialog();
187+
}
188+
}
182189
private void 账户管理ToolStripMenuItem_Click(object sender, EventArgs e)
183190
{
184191
//该部分比较复杂,需要对委托,匿名委托概念比较清晰

0 commit comments

Comments
 (0)