Skip to content

Commit b3df625

Browse files
committed
Update to .Net Core 3.0 and .Net Standard 2.1
1 parent f0357be commit b3df625

15 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/Berrysoft.Console/CommandLine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private Dictionary<string, string> InitArgs(string[] args)
136136
{
137137
throw ExceptionHelper.ArgInvalid(argKey);
138138
}
139-
#if NETCOREAPP2_2
139+
#if NETCOREAPP
140140
if (!result.TryAdd(argKey, argValue))
141141
{
142142
throw ExceptionHelper.ArgInvalid(argKey);

src/Berrysoft.Console/XmlSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public abstract class XmlSettings : SettingsBase
2222
{
2323
private readonly XName rootName;
2424
private HashSet<string> multipleNames = new HashSet<string>();
25-
#if NETCOREAPP2_2
25+
#if NETCOREAPP
2626
private readonly object syncLock = new object();
2727
#endif
2828
/// <summary>
@@ -89,7 +89,7 @@ public override void Open(string fileName)
8989
this[name] = propValue;
9090
}
9191
}
92-
#if NETCOREAPP2_2
92+
#if NETCOREAPP
9393
/// <summary>
9494
/// Open an xml file and parse it asynchronously.
9595
/// </summary>
@@ -163,7 +163,7 @@ public override void Save(string fileName)
163163
}
164164
document.Save(fileName);
165165
}
166-
#if NETCOREAPP2_2
166+
#if NETCOREAPP
167167
/// <summary>
168168
/// Save the settings to an xml file.
169169
/// </summary>

src/Berrysoft.Data/Graph.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ public class Graph<T> : IGraph<T>
547547
/// Initialize an instance of <see cref="Graph{T}"/>.
548548
/// </summary>
549549
public Graph()
550-
#if NETCOREAPP2_2 || NET472
550+
#if NETCOREAPP || NET472
551551
: this(0, 0, null)
552552
#else
553553
: this((IEqualityComparer<T>)null)
@@ -558,7 +558,7 @@ public Graph()
558558
/// </summary>
559559
/// <param name="comparer">An instance of <see cref="IEqualityComparer{T}"/>; default when <see langword="null"/>.</param>
560560
public Graph(IEqualityComparer<T> comparer)
561-
#if NETCOREAPP2_2 || NET472
561+
#if NETCOREAPP || NET472
562562
: this(0, 0, comparer)
563563
{ }
564564
#else
@@ -567,7 +567,7 @@ public Graph(IEqualityComparer<T> comparer)
567567
_arcs = new MultiMap<T, T>(comparer, comparer);
568568
}
569569
#endif
570-
#if NETCOREAPP2_2 || NET472
570+
#if NETCOREAPP || NET472
571571
/// <summary>
572572
/// Initialize an instance of <see cref="Graph{T}"/>.
573573
/// </summary>

src/Berrysoft.Html/HtmlAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public HtmlAttribute(string name, string attrvalue)
3838
/// <returns>A string.</returns>
3939
public override string ToString()
4040
{
41-
#if NETCOREAPP2_2
41+
#if NETCOREAPP
4242
if (attrvalue.Contains('\"'))
4343
#else
4444
if (attrvalue.Contains("\""))

src/Berrysoft.Html/HtmlDocument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private void WriteToStream(StreamWriter writer, HtmlObject obj)
7171
switch (obj)
7272
{
7373
case HtmlNode node:
74-
#if NETCOREAPP2_2
74+
#if NETCOREAPP
7575
writer.Write("<{0} {1}>", node.Name, string.Join(' ', node.Attributes()));
7676
#else
7777
writer.Write("<{0} {1}>", node.Name, string.Join(" ", node.Attributes()));
@@ -109,7 +109,7 @@ private async Task WriteToStreamAsync(StreamWriter writer, HtmlObject obj)
109109
switch (obj)
110110
{
111111
case HtmlNode node:
112-
#if NETCOREAPP2_2
112+
#if NETCOREAPP
113113
await writer.WriteAsync($"<{node.Name} {string.Join(' ', node.Attributes())}>");
114114
#else
115115
await writer.WriteAsync($"<{node.Name} {string.Join(" ", node.Attributes())}>");

src/Berrysoft.Html/HtmlNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ public override string ToString()
137137
{
138138
if (objs.Count > 0)
139139
{
140-
#if NETCOREAPP2_2
140+
#if NETCOREAPP
141141
return $"<{Name} {string.Join(' ', Attributes())}>{string.Concat(Elements())}</{Name}>";
142142
#else
143143
return $"<{Name} {string.Join(" ", Attributes().Select(attr => attr.ToString()))}>{string.Concat(Elements())}</{Name}>";
144144
#endif
145145
}
146146
else
147147
{
148-
#if NETCOREAPP2_2
148+
#if NETCOREAPP
149149
return $"<{Name} {string.Join(' ', Attributes())} />";
150150
#else
151151
return $"<{Name} {string.Join(" ", Attributes().Select(attr => attr.ToString()))} />";

src/Berrysoft.Html/Markdown/MdElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static IEnumerable<MdElement> GetElements(string[] lines)
3939
{
4040
yield return new MdCodeElement(lines, ref i);
4141
}
42-
#if NETCOREAPP2_2
42+
#if NETCOREAPP
4343
else if (TableRegex.IsMatch(line) && line.Contains('|'))
4444
#else
4545
else if (TableRegex.IsMatch(line) && line.Contains("|"))

src/Berrysoft.Html/Markdown/MdTableElement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public override HtmlNode ToHtmlNode()
8686
HtmlNode table = new HtmlNode("table");
8787
HtmlNode tr = new HtmlNode("tr");
8888
table.AddElement(new HtmlNode("thead", tr));
89-
#if NETCOREAPP2_2
89+
#if NETCOREAPP
9090
string[] heads = head.Split('|', StringSplitOptions.RemoveEmptyEntries);
9191
#else
9292
string[] heads = head.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
@@ -109,7 +109,7 @@ public override HtmlNode ToHtmlNode()
109109
table.AddElement(tbody);
110110
foreach (string line in elements)
111111
{
112-
#if NETCOREAPP2_2
112+
#if NETCOREAPP
113113
string[] es = line.Split('|', StringSplitOptions.RemoveEmptyEntries);
114114
#else
115115
string[] es = line.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

src/Berrysoft.Html/Markdown/MdTextAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static IEnumerable<MdToken> GetTextTokens(string text, int offset)
3232
result.AddRange(StrongAnalyzer.GetTokens(text, offset));
3333
result.AddRange(HyperlinkAnalyzer.GetTokens(text, offset));
3434
result.AddRange(ImageAnalyzer.GetTokens(text, offset));
35-
#if NETCOREAPP2_2
35+
#if NETCOREAPP
3636
if (!(text.EndsWith('*') || text.EndsWith('`') || text.EndsWith(')')))
3737
#else
3838
if (!(text.EndsWith("*") || text.EndsWith("`") || text.EndsWith(")")))

src/Berrysoft.Unsafe/UnsafeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void StackAlloc<T>(int size, Action<Pointer<T>> action)
8181
byte* ptr = stackalloc byte[size * SizeOf<T>()];
8282
action(new Pointer<T>(ptr));
8383
}
84-
#if NETCOREAPP2_2
84+
#if NETCOREAPP
8585
/// <summary>
8686
/// Get a <see cref="Span{T}"/> of a <see cref="Pointer{T}"/>.
8787
/// </summary>

0 commit comments

Comments
 (0)