* UIForm:修改不显示标题时标题栏的按钮位置仍然可以点击的Bug
This commit is contained in:
parent
52caed5317
commit
68a806126a
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
@ -411,7 +411,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
protected override void OnMouseClick(MouseEventArgs e)
|
protected override void OnMouseClick(MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (FormBorderStyle == FormBorderStyle.None)
|
if (FormBorderStyle == FormBorderStyle.None && ShowTitle)
|
||||||
{
|
{
|
||||||
if (InControlBox)
|
if (InControlBox)
|
||||||
{
|
{
|
||||||
|
@ -431,6 +431,7 @@
|
|||||||
<Compile Include="Units\UConcurrentDoubleKeyDictionary.cs" />
|
<Compile Include="Units\UConcurrentDoubleKeyDictionary.cs" />
|
||||||
<Compile Include="Units\UConcurrentGroupDictionary.cs" />
|
<Compile Include="Units\UConcurrentGroupDictionary.cs" />
|
||||||
<Compile Include="Units\UDateTimeInt64.cs" />
|
<Compile Include="Units\UDateTimeInt64.cs" />
|
||||||
|
<Compile Include="Units\UJson.cs" />
|
||||||
<Compile Include="Units\UJsonConfig.cs" />
|
<Compile Include="Units\UJsonConfig.cs" />
|
||||||
<Compile Include="Units\USnowflakeID.cs" />
|
<Compile Include="Units\USnowflakeID.cs" />
|
||||||
<Compile Include="Units\USuspendCtrlAltDel.cs" />
|
<Compile Include="Units\USuspendCtrlAltDel.cs" />
|
||||||
|
73
SunnyUI/Units/UJson.cs
Normal file
73
SunnyUI/Units/UJson.cs
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* SunnyUI 开源控件库、工具类库、扩展类库、多页面开发框架。
|
||||||
|
* CopyRight (C) 2012-2020 ShenYongHua(沈永华).
|
||||||
|
* QQ群:56829229 QQ:17612584 EMail:SunnyUI@qq.com
|
||||||
|
*
|
||||||
|
* Blog: https://www.cnblogs.com/yhuse
|
||||||
|
* Gitee: https://gitee.com/yhuse/SunnyUI
|
||||||
|
* GitHub: https://github.com/yhuse/SunnyUI
|
||||||
|
*
|
||||||
|
* SunnyUI.dll can be used for free under the GPL-3.0 license.
|
||||||
|
* If you use this code, please keep this note.
|
||||||
|
* 如果您使用此代码,请保留此说明。
|
||||||
|
******************************************************************************
|
||||||
|
* 文件名称: UJson.cs
|
||||||
|
* 文件说明: Json扩展类,不引用第三方组件实现简单的Json字符串和对象的转换
|
||||||
|
* 当前版本: V2.2
|
||||||
|
* 创建日期: 2020-10-21
|
||||||
|
*
|
||||||
|
* 2020-10-21: V2.2.9 增加文件说明
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web.Script.Serialization;
|
||||||
|
|
||||||
|
namespace Sunny.UI
|
||||||
|
{
|
||||||
|
public static class Json
|
||||||
|
{
|
||||||
|
public static T Deserialize<T>(string input)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||||
|
return js.Deserialize<T>(input);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
return default(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Serialize(object obj)
|
||||||
|
{
|
||||||
|
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||||
|
return js.Serialize(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T DeserializeFromFile<T>(string filename, Encoding encoding)
|
||||||
|
{
|
||||||
|
string jsonStr = File.ReadAllText(filename, encoding);
|
||||||
|
return Deserialize<T>(jsonStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string SerializeToFile(object obj, string filename, Encoding encoding)
|
||||||
|
{
|
||||||
|
string jsonStr = Serialize(obj);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DirEx.CreateDir(Path.GetDirectoryName(filename));
|
||||||
|
File.WriteAllText(filename, jsonStr, encoding);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return jsonStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -22,7 +22,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web.Script.Serialization;
|
|
||||||
|
|
||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
@ -54,9 +53,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string jsonStr = File.ReadAllText(filename, Encoding.Default);
|
current = Json.DeserializeFromFile<TConfig>(filename, Encoding.Default);
|
||||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
|
||||||
current = js.Deserialize<TConfig>(jsonStr);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -80,10 +77,7 @@ namespace Sunny.UI
|
|||||||
throw new ApplicationException($"未指定{typeof(TConfig).Name}的配置文件路径!");
|
throw new ApplicationException($"未指定{typeof(TConfig).Name}的配置文件路径!");
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
Json.SerializeToFile(current, filename, Encoding.Default);
|
||||||
string jsonStr = js.Serialize(current);
|
|
||||||
DirEx.CreateDir(Path.GetDirectoryName(filename));
|
|
||||||
File.WriteAllText(filename, jsonStr, Encoding.Default);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user