Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

Commit 709880f

Browse files
committed
Release V0.8.0
1. Improve code structure and comments. 2. Update README. 3. Use Syncfusion NuGet packages instead of the corresponding assemblies. 4. Integrate PortableSettingsProvider V0.2.4 to override the default settings provider to provide better user experience. 5. Upgrade HtmlAgilityPack from V1.11.24 to V1.11.28. 6. Upgrade Syncfusion WPF UI from V18.2.0.44 to V18.3.0.53. 7. Change the Chinese name of the app to "神户座". 8. Adjust the layout of the installation dialogue of the setup EXE file. 9. Improve text contents of the setup EXE file. 10. Reduce application files and adjust the organisation of the setup EXE file. 11. The users are now allowed to choose whether to keep the user config together with some other temp files or not when uninstalling the application. 12. Optimise the explanation of some settings. 13. Optimise the rounding function for day volumes. Now, the specified number of decimal digits can be kept without dropping 0. 14. Adjust the appearance of buttons. 15. The advanced filter of the data grid can now generate unique items in the list. 16. Add support for applying the font family specified in the settings to the controls on the Print Preview window. 17. Update the URL of the product's GitHub repository on the window for showing the info about the product. 18. Fix a bug that some files are not removed when the application is uninstalled. 19. Fix a bug that the user settings restore to default values after upgrading the application. Reconfigure the application as you like, and your preferences should be kept when the application is upgraded next time. 20. Fix a bug that the column for total volumes can be lengthened or shortened without limitation. 21. Fix a bug that the icon of the Print Preview window is incorrect. 22. Fix a bug that some words in the Print Preview window are not displayed in simplified Chinese. 23. Fix a bug that the print preview function works improperly in the dark mode.
1 parent a643fcf commit 709880f

38 files changed

+3754
-5306
lines changed

README-zhCN.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 沪深小助手(Windows版)
1+
# 神户座
22

33
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/ArvinZJC/ShSzStockHelper-Windows?include_prereleases)](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)
44
[![GitHub All Releases](https://img.shields.io/github/downloads/ArvinZJC/ShSzStockHelper-Windows/total)](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)
@@ -7,9 +7,12 @@
77

88
[English](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/README.md) | **简体中文**
99

10-
沪深小助手主要用来帮助用户搜索成交价和成交量,可看作是对分价表的组合加工。“沪深”所指代的啥就不多说了,懂的都懂。这款应用程序实现的功能算不上太复杂,设计的目的主要是为了满足一些中国大陆用户的需求(包括家人),因而此应用程序支持的语言仅有简体中文。
10+
神户座是一个Windows应用程序,它主要用来帮助用户搜索成交价和成交量,可看作是对分价表的组合加工。“神户”玩儿的是谐音梗,指代“沪深”。“沪深”的意思就不多说了,懂的都懂。这款应用程序实现的功能算不上太复杂,设计的目的主要是为了满足一些中国大陆用户的需求(包括家人),因而此应用程序支持的语言仅有简体中文。请注意此项目使用[GPL-3.0协议](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/LICENSE)
1111

12-
此项目包含了此应用程序的Windows版的源码。请注意此项目使用[GPL-3.0协议](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/LICENSE)
12+
## 注意
13+
14+
1. 应用程序配置文件和相应的更新日志可在[发行](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)部分找到。从[V0.3.0](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases/tag/v0.3.0)开始,此项目采用了一个全新的打包方案,制作出来的应用程序配置文件功能体系更全,体积更小,也因此**从低于V0.3.0的版本升级时必须手动卸载旧版本**
15+
2. 应用程序支持**Windows 7/8/8.1/10**
1316

1417
## 文件夹说明
1518

@@ -25,9 +28,4 @@
2528

2629
这个文件夹包含了一个Jupyter Notebook文件,其中用Python代码实现了查询沪深股票代码和相应的股票名称,并将它们保存在一个JSON格式的文件中。这个数据文件是应用程序资源的一部分。
2730

28-
## 注意
29-
30-
1. 应用程序配置文件可从[发行](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)部分下载。从[V0.3.0](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases/tag/v0.3.0)开始,此项目采用了一个全新的打包方案,制作出来的应用程序配置文件功能体系更全,体积更小,也因此**从低于V0.3.0的版本升级时必须手动卸载旧版本**
31-
2. 应用程序支持Windows 7/8/8.1/10。
32-
3331
更多信息请参见各文件夹的README。

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SH/SZ Stock Helper for Windows
1+
# SH/SZ Stock Helper
22

33
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/ArvinZJC/ShSzStockHelper-Windows?include_prereleases)](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)
44
[![GitHub All Releases](https://img.shields.io/github/downloads/ArvinZJC/ShSzStockHelper-Windows/total)](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases)
@@ -7,9 +7,12 @@
77

88
**English** | [简体中文](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/README-zhCN.md)
99

10-
SH/SZ Stock Helper can mainly search strike prices and volumes for the users. Here SH represents Shanghai Stock Exchange, while SZ means Shenzhen Stock Exchange. Please note that this application is mainly designed for a specified part of Chinese users, and contents are displayed in simplified Chinese.
10+
SH/SZ Stock Helper is a Windows application which can mainly search strike prices and volumes for the users. Here SH represents Shanghai Stock Exchange, while SZ means Shenzhen Stock Exchange. The application is mainly designed for a specified part of Chinese users, and contents are displayed in simplified Chinese. Please note that the code is licensed under [the GPL-3.0 License](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/LICENSE).
1111

12-
This repository contains the source code of the Windows version of the application. Please note that the code is licensed under [the GPL-3.0 License](https://github.com/ArvinZJC/ShSzStockHelper-Windows/blob/master/LICENSE).
12+
## ATTENTION
13+
14+
1. The setup EXE files and the corresponding changelogs can be found in the [Releases](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases) section. From [V0.3.0](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases/tag/v0.3.0), a totally new solution to build the setup file is applied to make it more powerful (but with a smaller size) and **any version older than V0.3.0 should be manually uninstalled**.
15+
2. The application supports **Windows 7/8/8.1/10**.
1316

1417
## Folder Instructions
1518

@@ -25,9 +28,4 @@ This is the Advanced Installer project folder. The files in the folder are mainl
2528

2629
This folder contains a Jupyter Notebook file with Python code to retrieve and store a list of symbols and corresponding names of SH/SZ stocks in a JSON file which is a part of the resources of the application.
2730

28-
## ATTENTION
29-
30-
1. The setup EXE files can be downloaded from [Releases](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases) section. From [V0.3.0](https://github.com/ArvinZJC/ShSzStockHelper-Windows/releases/tag/v0.3.0), a totally new solution to build the setup file is applied to make it more powerful (but with a smaller size) and **any version older than V0.3.0 should be manually uninstalled**.
31-
2. The application supports Windows 7/8/8.1/10.
32-
3331
For more information, please refer to the README file in each folder.

ShSzStockHelper/App.xaml.cs

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/*
22
* @Description: the back-end code of initialising the app
3-
* @Version: 1.0.6.20200916
3+
* @Version: 1.0.8.20201130
44
* @Author: Arvin Zhao
55
* @Date: 2020-07-08 10:17:48
66
* @Last Editors: Arvin Zhao
7-
* @LastEditTime: 2020-09-16 14:14:55
7+
* @LastEditTime: 2020-11-30 14:14:55
88
*/
99

10+
using Bluegrams.Application;
1011
using Syncfusion.Licensing;
1112
using Syncfusion.SfSkinManager;
1213
using System;
14+
using System.Diagnostics;
1315
using System.Globalization;
16+
using System.IO;
1417
using System.Reflection;
1518
using System.Threading;
1619
using System.Windows;
@@ -22,14 +25,60 @@ namespace ShSzStockHelper
2225
/// </summary>
2326
public partial class App
2427
{
28+
private static string _productId, _productName, _productVersion, _productCopyright;
2529
private Mutex _mutex; // It is important to declare the mutex here. Otherwise, it may have no effect.
2630

2731
/// <summary>
2832
/// Initialise a new instance of the <see cref="App"/> class.
2933
/// </summary>
3034
public App()
3135
{
32-
SyncfusionLicenseProvider.RegisterLicense("Mjg5NjU2QDMxMzgyZTMyMmUzMEMwbk5LbjVFbW5VU1ZqUDFmbkF5eXF6dURJVkZ5RDgyNjVnMXF2d0h1c0k9"); // Register Syncfusion license.
36+
SyncfusionLicenseProvider.RegisterLicense("MzI2OTM0QDMxMzgyZTMzMmUzMGFyTEY5ai9VTGlKRXcrdlpLSjU5VUlHR1ZZZzkxeDlBYzdkMHMvY0d0LzA9"); // Register a Syncfusion license.
37+
38+
_productId = Assembly.GetExecutingAssembly().GetName().Name;
39+
_productName = ShSzStockHelper.Properties.Resources.NullProductNameError;
40+
_productVersion = ShSzStockHelper.Properties.Resources.NullProductVersionError;
41+
_productCopyright = ShSzStockHelper.Properties.Resources.NullProductCopyrightError;
42+
43+
string productCompany = null;
44+
var assembly = Assembly.GetEntryAssembly();
45+
46+
if (assembly != null)
47+
{
48+
var fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
49+
var assemblyVersionAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
50+
var assemblyCopyrightAttribute = assembly.GetCustomAttribute<AssemblyCopyrightAttribute>();
51+
52+
_productName = fileVersionInfo.ProductName;
53+
54+
if (assemblyVersionAttribute != null)
55+
_productVersion = assemblyVersionAttribute.InformationalVersion;
56+
57+
productCompany = fileVersionInfo.CompanyName;
58+
59+
if (assemblyCopyrightAttribute != null)
60+
_productCopyright = assemblyCopyrightAttribute.Copyright;
61+
} // end if
62+
63+
// Configure the customised settings provider.
64+
PortableSettingsProvider.SettingsFileName = "user.config";
65+
66+
if (_productId != null && productCompany != null)
67+
{
68+
// ReSharper disable once RedundantAssignment
69+
var customisedSettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), productCompany, _productId);
70+
71+
#if DEBUG
72+
customisedSettingsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), productCompany, _productId + "_debug");
73+
#endif
74+
75+
if (!Directory.Exists(customisedSettingsDirectory))
76+
Directory.CreateDirectory(customisedSettingsDirectory);
77+
78+
PortableSettingsProviderBase.SettingsDirectory = customisedSettingsDirectory;
79+
} // end if
80+
81+
PortableSettingsProvider.ApplyProvider(ShSzStockHelper.Properties.Settings.Default);
3382

3483
if (ShSzStockHelper.Properties.Settings.Default.ProductTheme == (int) VisualStyles.MaterialDark)
3584
Current.Resources.MergedDictionaries.Add((ResourceDictionary)LoadComponent(new Uri("Resources/MaterialDark/Theme.xaml", UriKind.Relative)));
@@ -46,13 +95,40 @@ public App()
4695

4796
protected override void OnStartup(StartupEventArgs e)
4897
{
49-
_mutex = new Mutex(true, Assembly.GetExecutingAssembly().GetName().Name);
98+
_mutex = new Mutex(true, _productId);
5099

51100
// Allow running only 1 instance of the product.
52101
if (_mutex.WaitOne(0, false))
53102
base.OnStartup(e);
54103
else
55104
Shutdown();
56105
} // end method OnStartUp
106+
107+
/// <summary>
108+
/// Get the name of the product.
109+
/// </summary>
110+
/// <returns>The name of the product.</returns>
111+
public static string GetProductName()
112+
{
113+
return _productName;
114+
} // end method GetProductName
115+
116+
/// <summary>
117+
/// Get the version of the product.
118+
/// </summary>
119+
/// <returns>The version of the product.</returns>
120+
public static string GetProductVersion()
121+
{
122+
return _productVersion;
123+
} // end method GetProductName
124+
125+
/// <summary>
126+
/// Get the copyright of the product.
127+
/// </summary>
128+
/// <returns>The copyright of the product.</returns>
129+
public static string GetProductCopyright()
130+
{
131+
return _productCopyright;
132+
} // end method GetProductName
57133
} // end class App
58134
} // end namespace ShSzStockHelper

0 commit comments

Comments
 (0)