-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 增加 ConfigOutput 以便控制输出。 2. 增加 ConfigReferenceCombineBehavior 配置引用合并策略。 3. 修改 ConfigReferenceLoadBehavior 配置主域及当前域的家在行为。 4. 修改 ConfigAssemblyLoadBehavior 配置当前域程序集的加载行为。 5. 修改 ConfigSameNameReferencesFilter 引用同名过滤策略。
- Loading branch information
Showing
425 changed files
with
1,589 additions
and
1,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...harp/Natasha.CSharp.Compiler/MultiDomain/CompileUnit/AssemblyCSharpBuilder.Ouput.Multi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Natasha.CSharp/Natasha.CSharp.Compiler/Natasha.CSharp.Compiler.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...Sharp/Natasha.CSharp.Compiler/Public/Component/Compiler/Model/CombineReferenceBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public enum CombineReferenceBehavior | ||
{ | ||
CombineDefault, | ||
UseCurrent | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
src/Natasha.CSharp/Natasha.CSharp.Template/MultiDomain/Standard/GlobalUsingTemplate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#if MULTI | ||
using System.Diagnostics; | ||
using System.Text; | ||
|
||
namespace Natasha.CSharp.Template | ||
|
2 changes: 1 addition & 1 deletion
2
src/Natasha.CSharp/Natasha.CSharp.Template/Natasha.CSharp.Template.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
src/Natasha.CSharp/Natasha.CSharp.Template/Public/Extension/Inner/StopwatchExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Diagnostics; | ||
|
||
|
||
internal static class StopwatchExtension | ||
{ | ||
private static readonly ConcurrentDictionary<ScoreRange, ConsoleColor> _colorCache; | ||
static StopwatchExtension() | ||
{ | ||
_colorCache = new ConcurrentDictionary<ScoreRange, ConsoleColor>(); | ||
_colorCache[new ScoreRange(0, 20)] = ConsoleColor.Green; | ||
_colorCache[new ScoreRange(20, 100)] = ConsoleColor.Cyan; | ||
_colorCache[new ScoreRange(100, 500)] = ConsoleColor.Yellow; | ||
_colorCache[new ScoreRange(500, 1000)] = ConsoleColor.Magenta; | ||
_colorCache[new ScoreRange(1000, 100000)] = ConsoleColor.Red; | ||
} | ||
internal static void StopAndShowCategoreInfo(this Stopwatch stopwatch, string nodeName, string info, int level) | ||
{ | ||
stopwatch.Stop(); | ||
ShowCategoreInfo(stopwatch, nodeName, info, level); | ||
} | ||
|
||
|
||
internal static void RestartAndShowCategoreInfo(this Stopwatch stopwatch, string nodeName, string info, int level) | ||
{ | ||
stopwatch.Stop(); | ||
ShowCategoreInfo(stopwatch, nodeName, info, level); | ||
stopwatch.Restart(); | ||
} | ||
|
||
|
||
|
||
internal static void ShowCategoreInfo(Stopwatch stopwatch, string nodeName, string info, int level) | ||
{ | ||
var color = Console.ForegroundColor; | ||
foreach (var item in _colorCache) | ||
{ | ||
if (item.Key.IsInRange(stopwatch.ElapsedMilliseconds)) | ||
{ | ||
Console.ForegroundColor = item.Value; | ||
for (int i = 0; i < level; i += 1) | ||
{ | ||
Console.Write("\t"); | ||
} | ||
Console.WriteLine($"---{nodeName}\t{info} : {stopwatch.ElapsedMilliseconds}ms"); | ||
} | ||
} | ||
Console.ForegroundColor = color; | ||
} | ||
|
||
|
||
|
||
/// <summary> | ||
/// 设置颜色等级 | ||
/// </summary> | ||
/// <param name="stopwatch"></param> | ||
/// <param name="scoreRange"></param> | ||
/// <param name="color"></param> | ||
/// <returns></returns> | ||
internal static Stopwatch SetLevel(this Stopwatch stopwatch, ScoreRange scoreRange, ConsoleColor color) | ||
{ | ||
_colorCache[scoreRange] = color; | ||
return stopwatch; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// 分数模型 | ||
/// </summary> | ||
internal class ScoreRange | ||
{ | ||
private readonly long _min; | ||
private readonly long _max; | ||
|
||
internal ScoreRange(long min, long max) | ||
{ | ||
_min = min; | ||
_max = max; | ||
} | ||
/// <summary> | ||
/// 判断得分是否在范围内 | ||
/// </summary> | ||
/// <param name="score"></param> | ||
/// <returns></returns> | ||
internal bool IsInRange(long score) | ||
{ | ||
return _min <= score && score <= _max; | ||
} | ||
} | ||
|
4 changes: 3 additions & 1 deletion
4
src/Natasha.CSharp/Natasha.CSharp.Template/Public/Oop/Extension/OopDefinedTypeExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.