Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DefineMethod()

MethodInfo System.Xml.Xsl.IlGen.XmlILModule.DefineMethod ( string name,
Type returnType,
Type[] paramTypes,
string[] paramNames,
XmlILMethodAttributes xmlAttrs )
inline

Definition at line 62 of file XmlILModule.cs.

63 {
64 int num = 1;
65 string text = name;
66 bool flag = (xmlAttrs & XmlILMethodAttributes.Raw) != 0;
67 while (_methods[name] != null)
68 {
69 num++;
70 name = text + " (" + num + ")";
71 }
72 if (!flag)
73 {
74 Type[] array = new Type[paramTypes.Length + 1];
76 Array.Copy(paramTypes, 0, array, 1, paramTypes.Length);
78 }
80 if (!_useLRE)
81 {
83 if (_emitSymbols && (xmlAttrs & XmlILMethodAttributes.NonUser) != 0)
84 {
85 methodBuilder.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.StepThrough, Array.Empty<object>()));
86 methodBuilder.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.NonUserCode, Array.Empty<object>()));
87 }
88 if (!flag)
89 {
90 methodBuilder.DefineParameter(1, ParameterAttributes.None, "{urn:schemas-microsoft-com:xslt-debug}runtime");
91 }
92 for (int i = 0; i < paramNames.Length; i++)
93 {
94 if (paramNames[i] != null && paramNames[i].Length != 0)
95 {
96 methodBuilder.DefineParameter(i + (flag ? 1 : 2), ParameterAttributes.None, paramNames[i]);
97 }
98 }
100 }
101 else
102 {
106 }
108 return methodInfo;
109 }
static int DefineMethod(QCallModule module, int tkParent, string name, byte[] signature, int sigLength, MethodAttributes attributes)
static readonly ModuleBuilder s_LREModule

References System.Xml.Xsl.IlGen.XmlILModule._emitSymbols, System.Xml.Xsl.IlGen.XmlILModule._methods, System.Xml.Xsl.IlGen.XmlILModule._typeBldr, System.Xml.Xsl.IlGen.XmlILModule._useLRE, System.array, System.Array.Copy(), System.Reflection.Emit.TypeBuilder.DefineMethod(), System.Xml.Dictionary, System.Xml.Xsl.IlGen.XmlILConstructors.NonUserCode, System.Xml.Xsl.IlGen.XmlILModule.s_LREModule, System.Xml.Xsl.IlGen.XmlILConstructors.StepThrough, and System.text.

Referenced by System.Xml.Xsl.XmlILGenerator.CreateFunctionMetadata(), System.Xml.Xsl.XmlILGenerator.CreateGlobalValueMetadata(), System.Xml.Xsl.XmlILGenerator.CreateHelperFunctions(), and System.Xml.Xsl.XmlILGenerator.Generate().