本文整理汇总了C#中Mono.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Mono.ToString方法的具体用法?C# Mono.ToString怎么用?C# Mono.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono
的用法示例。
在下文中一共展示了Mono.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNameFromNewObjMethodReference
private static string GetNameFromNewObjMethodReference(Mono.Cecil.MethodReference methodReference)
{
string[] array = methodReference.ToString().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
string[] array2 = array[1].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries);
return array2[0].Trim();
}
示例2: GetCallNameFromAnalyzeMethodCalls
private static string GetCallNameFromAnalyzeMethodCalls(Mono.Cecil.MethodReference methodReference)
{
string[] array = methodReference.ToString().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
return array[1].Trim();
}
示例3: ExtractClassType
private Type ExtractClassType(Mono.Cecil.MemberReference operand)
{
Type type = null;
string typeName = operand.ToString();
if (operand.DeclaringType != null)
typeName = operand.DeclaringType.FullName.Replace('/', '+');
type = Type.GetType(typeName);
if (type == null)
//TODO: Not correct, the module refers to current module, not the declaring type's module
type = Type.GetType(typeName + ", " + operand.DeclaringType.Module.Assembly.Name.ToString(), true);
return type;
}
示例4: GetGenericAttributeDesc
public static string GetGenericAttributeDesc (Mono.Cecil.GenericParameterAttributes ga)
{
return ga.ToString ();
}
示例5: FillTree_Method
void FillTree_Method(Mono.Cecil.MethodDefinition method)
{
treeView2.Tag = method;
treeView2.Nodes.Clear();
TreeNode methodinfo = new TreeNode(method.ToString());
treeView2.Nodes.Add(methodinfo);
if (method.HasParameters)
{
TreeNode paraminfo = new TreeNode("Params");
treeView2.Nodes.Add(paraminfo);
for (int i = 0; i < method.Parameters.Count; i++)
{
TreeNode p = new TreeNode(method.Parameters[i].ParameterType + " " + method.Parameters[i].Name);
paraminfo.Nodes.Add(p);
}
}
TreeNode body = new TreeNode("Body");
treeView2.Nodes.Add(body);
if (method.HasBody)
{
TreeNode variables = new TreeNode("Variables");
body.Nodes.Add(variables);
if (method.Body.HasVariables)
{
foreach (var v in method.Body.Variables)
{
TreeNode var = new TreeNode(v.VariableType + " " + v.Name);
variables.Nodes.Add(var);
}
}
TreeNode eh = new TreeNode("ExceptionHandlers");
body.Nodes.Add(eh);
if (method.Body.HasExceptionHandlers)
{
foreach (Mono.Cecil.Cil.ExceptionHandler v in method.Body.ExceptionHandlers)
{
TreeNode var = new TreeNode(v.ToString());
eh.Nodes.Add(v.HandlerType + " " + v.CatchType + "(" + v.HandlerStart + "," + v.HandlerEnd + ")");
}
}
TreeNode code = new TreeNode("Code");
body.Nodes.Add(code);
foreach (Mono.Cecil.Cil.Instruction i in method.Body.Instructions)
{
string line = i.ToString();
//i.Offset
if (i.SequencePoint != null)
{
LoadCodeFile(i.SequencePoint.Document.Url);
line += " |(" + i.SequencePoint.StartLine + "," + i.SequencePoint.StartColumn + ")";
if (codes[i.SequencePoint.Document.Url] != null)
{
int lines = i.SequencePoint.StartLine;
if (lines - 1 < codes[i.SequencePoint.Document.Url].Length)
line += "| " + codes[i.SequencePoint.Document.Url][i.SequencePoint.StartLine - 1];
}
}
TreeNode op = new TreeNode(line);
op.Tag = i;
code.Nodes.Add(op);
}
}
treeView2.ExpandAll();
}