Skip to content

Commit 8110feb

Browse files
committed
[1.6.1]SetObject支持ToString
1 parent 7880b1f commit 8110feb

File tree

18 files changed

+88
-63
lines changed

18 files changed

+88
-63
lines changed

LinePutScript/Core/LinePutScript.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<ImplicitUsings>disable</ImplicitUsings>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>True</GenerateDocumentationFile>
88
<Title>LinePutScript</Title>

LinePutScript/Dictionary/Line.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ public DateTime this[gdat subName]
799799
get => GetDateTime((string)subName);
800800
set => SetDateTime((string)subName, value);
801801
}
802-
#endregion
803-
802+
#endregion
804803
}
805804
}

LinePutScript/Generics/Line.cs

Lines changed: 60 additions & 58 deletions
Large diffs are not rendered by default.

LinePutScript/Line.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,22 @@ public Line(string name, string info, string text = "", params Sub[] subs) : bas
3535
/// </summary>
3636
/// <param name="line">其他line</param>
3737
public Line(Line line) : base(line) { }
38+
39+
/// <summary>
40+
/// 克隆一个Line
41+
/// </summary>
42+
/// <returns>相同的Line</returns>
43+
public new object Clone()
44+
{
45+
return new Line(this);
46+
}
47+
/// <summary>
48+
/// 返回一个新List,包含所有Subs
49+
/// </summary>
50+
/// <returns>所有储存的Subs</returns>
51+
public new List<Sub> ToList()
52+
{
53+
return Subs.ToList();
54+
}
3855
}
3956
}

LinePutScript/LinePutScript.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>LinePutScript</RootNamespace>
1111
<AssemblyName>LinePutScript</AssemblyName>
12-
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1313
<LangVersion>8.0</LangVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<Deterministic>true</Deterministic>

LinePutScript/SetObject.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,13 @@ public override int GetHashCode()
638638
{
639639
return (int)Sub.GetHashCode(ToString());
640640
}
641+
/// <summary>
642+
/// 转换成文本形式
643+
/// </summary>
644+
public override string ToString()
645+
{
646+
return GetString();
647+
}
641648
}
642649

643650
}

LinePutScript/Sub.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static string TextReplace(string Reptex)
110110
/// <returns>HashCode</returns>
111111
public static long GetHashCode(string text)
112112
{
113-
using (MD5 md5 = MD5CryptoServiceProvider.Create())
113+
using (MD5 md5 = MD5.Create())
114114
{
115115
return BitConverter.ToInt64(md5.ComputeHash(Encoding.UTF8.GetBytes(text)), 0);
116116
}

nuget/LinePutScript.1.6.1.nupkg

329 KB
Binary file not shown.
-9.27 KB
Binary file not shown.
-9.25 KB
Binary file not shown.

0 commit comments

Comments
 (0)