Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Scripts.cs
Go to the documentation of this file.
5
6namespace System.Xml.Xsl.Xslt;
7
8internal sealed class Scripts
9{
10 internal sealed class TrimSafeDictionary
11 {
13
14 public Type this[string key]
15 {
16 [UnconditionalSuppressMessage("TrimAnalysis", "IL2073:MissingDynamicallyAccessedMembers", Justification = "The getter of the dictionary is not annotated to preserve the constructor, but the sources that are adding the items to the dictionary are annotated so we can supress the message as we know the constructor will be preserved.")]
17 [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
18 get
19 {
20 return _backingDictionary[key];
21 }
22 [param: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
23 set
24 {
26 }
27 }
28
30
32
33 public bool ContainsKey(string key)
34 {
36 }
37
38 public bool TryGetValue(string key, [MaybeNullWhen(false)] out Type value)
39 {
41 }
42 }
43
44 private readonly Compiler _compiler;
45
47
49
51
53 {
55 }
56
57 [RequiresUnreferencedCode("The extension function referenced will be called from the stylesheet which cannot be statically analyzed.")]
59 {
61 {
62 try
63 {
64 return _extFuncs.Bind(name, ns, numArgs, value, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public);
65 }
67 {
68 errorHelper.ReportError(ex.Message);
69 }
70 }
71 return null;
72 }
73}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
XmlExtensionFunction Bind(string name, string namespaceUri, int numArgs, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods|DynamicallyAccessedMemberTypes.NonPublicMethods)] Type objectType, BindingFlags flags)
bool TryGetValue(string key, [MaybeNullWhen(false)] out Type value)
Definition Scripts.cs:38
readonly Dictionary< string, Type > _backingDictionary
Definition Scripts.cs:12
TrimSafeDictionary ScriptClasses
Definition Scripts.cs:50
readonly XmlExtensionFunctionTable _extFuncs
Definition Scripts.cs:48
readonly Compiler _compiler
Definition Scripts.cs:44
Scripts(Compiler compiler)
Definition Scripts.cs:52
XmlExtensionFunction ResolveFunction(string name, string ns, int numArgs, IErrorHelper errorHelper)
Definition Scripts.cs:58
readonly TrimSafeDictionary _nsToType
Definition Scripts.cs:46