【问题标题】:How to skip method in step-into(F11)如何在步入中跳过方法(F11)
【发布时间】:2014-06-22 22:51:39
【问题描述】:

举个例子:

public static class Extensions
{
    public static string MakeString(this object obj)
    {
        if (obj == null) return string.Empty;

        return obj.ToString();
    }
}

public class ABC
{
    public void Method()
    {
        object obj = default(object);

        //Implemention goes here..

        // Here every time in step into navigate to MakeString() Method.
        if(IsValid(obj.MakeString()))             
        {
            //Operations..
        }
    }

    private bool IsValid(string str)
    {
        //Check if string is valid or not..
        return true;
    }
}

在这个例子中,Extentions 类具有扩展方法,并在 ABC 类中使用它,当在此扩展和其他方法调用的条件下步入时,每次我步入 MakeString() 方法时,可以我们跳过它?通过使用method attribute?还是其他方式?

【问题讨论】:

标签: c# step-into


【解决方案1】:

您可以为此使用DebuggerStepThrough 属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-07
    • 1970-01-01
    • 1970-01-01
    • 2016-08-18
    • 2016-05-06
    • 2017-06-12
    相关资源
    最近更新 更多