Cleanup, move OnBeforeAnyHookInvoked function to an interface
This commit is contained in:
@@ -23,15 +23,14 @@ public static class ScriptExecution
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
script.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
if (script is IScriptOnBeforeAnyHookInvoked onBeforeAnyHookInvoked)
|
||||
onBeforeAnyHookInvoked.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
}
|
||||
foreach (var container in iterator)
|
||||
{
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
if (script.IsSuppressed)
|
||||
continue;
|
||||
if (suppressedCategories != null && suppressedCategories.Contains(script.Category))
|
||||
continue;
|
||||
hook(script);
|
||||
@@ -51,15 +50,14 @@ public static class ScriptExecution
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
script.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
if (script is IScriptOnBeforeAnyHookInvoked onBeforeAnyHookInvoked)
|
||||
onBeforeAnyHookInvoked.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
}
|
||||
foreach (var container in iterator)
|
||||
{
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
if (script.IsSuppressed)
|
||||
continue;
|
||||
if (suppressedCategories != null && suppressedCategories.Contains(script.Category))
|
||||
continue;
|
||||
hook(script);
|
||||
@@ -78,15 +76,14 @@ public static class ScriptExecution
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
script.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
if (script is IScriptOnBeforeAnyHookInvoked onBeforeAnyHookInvoked)
|
||||
onBeforeAnyHookInvoked.OnBeforeAnyHookInvoked(ref suppressedCategories);
|
||||
}
|
||||
foreach (var container in source.SelectMany(x => x))
|
||||
{
|
||||
if (container.IsEmpty)
|
||||
continue;
|
||||
var script = container.Script;
|
||||
if (script.IsSuppressed)
|
||||
continue;
|
||||
if (suppressedCategories != null && suppressedCategories.Contains(script.Category))
|
||||
continue;
|
||||
hook(script);
|
||||
|
||||
Reference in New Issue
Block a user