当前位置: 首页>>代码示例>>C#>>正文


C# Mono.ToString方法代码示例

本文整理汇总了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();
 }
开发者ID:swatt6400,项目名称:NetOffice,代码行数:6,代码来源:AssemblyAnalyzer.cs

示例2: GetCallNameFromAnalyzeMethodCalls

 private static string GetCallNameFromAnalyzeMethodCalls(Mono.Cecil.MethodReference methodReference)
 {
     string[] array = methodReference.ToString().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
     return array[1].Trim();
 }
开发者ID:swatt6400,项目名称:NetOffice,代码行数:5,代码来源:AssemblyAnalyzer.cs

示例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;
        }
开发者ID:kenkendk,项目名称:ac3il,代码行数:16,代码来源:InstructionElement.cs

示例4: GetGenericAttributeDesc

		public static string GetGenericAttributeDesc (Mono.Cecil.GenericParameterAttributes ga)
		{
			return ga.ToString ();
		}
开发者ID:boothead,项目名称:mono-tools,代码行数:4,代码来源:Metadata.cs

示例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();
        }
开发者ID:wjezxujian,项目名称:LSharp,代码行数:67,代码来源:Form1.cs


注:本文中的Mono.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。