Home All Groups Group Topic Archive Search About

Debugger Step Over Attribute

Author
20 Nov 2006 3:22 PM
Mark Ingram
Hi, is there an debugger step over attribute that I can use on
properties? For instance, I have a singlton class with an "Instance"
property:

public MyClass Instance
{
    get
    {
        if (m_instance == null)
        {
            m_instance = new MyClass();
        }

        return m_instance;
    }
}

It's annoying when i have a function like,
MyClass.Instance.DoSomething(). I have to use the step into command, but
first it steps into the property, then i have to go out of that and step
in again to go into the actual function.

Thanks,

Author
20 Nov 2006 3:41 PM
Vadym Stetsyak
Hello, Mark!

Have you tried "DebuggerStepThroughAttribute" attribyte?

MI> Hi, is there an debugger step over attribute that I can use on
MI> properties? For instance, I have a singlton class with an "Instance"
MI> property:

MI> public MyClass Instance
MI> {
MI> get
MI> {
MI> if (m_instance == null)
MI> {
MI> m_instance = new MyClass();
MI> }

MI> return m_instance;
MI> }
MI> }

MI> It's annoying when i have a function like,
MI> MyClass.Instance.DoSomething(). I have to use the step into command,
MI> but
MI> first it steps into the property, then i have to go out of that and
MI> step
MI> in again to go into the actual function.

MI> Thanks,

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
20 Nov 2006 5:12 PM
Mark Ingram
Vadym Stetsyak wrote:
> Hello, Mark!
>
> Have you tried "DebuggerStepThroughAttribute" attribyte?
>

Hi, thanks, but that only works on functions! A Bit annoying because it
does what I need perfectly!

I am toying with making my own attribute class to enable the same
functionality, but just for properties.
Author
21 Nov 2006 7:39 AM
Vadym Stetsyak
Hello, Mark!

IIRC there is no problem with properties.

e.g.
public static MySingleton Instance
{
    [DebuggerStepThrough]
    get { return instance; }
}

MI> Vadym Stetsyak wrote:
>> Hello, Mark!

>> Have you tried "DebuggerStepThroughAttribute" attribyte?


MI> Hi, thanks, but that only works on functions! A Bit annoying because
MI> it
MI> does what I need perfectly!

MI> I am toying with making my own attribute class to enable the same
MI> functionality, but just for properties.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Author
21 Nov 2006 10:50 AM
Mark Ingram
Vadym Stetsyak wrote:
Show quote
> Hello, Mark!
>
> IIRC there is no problem with properties.
>
> e.g.
> public static MySingleton Instance
> {
>     [DebuggerStepThrough]
>     get { return instance; }
> }
>
>  MI> Vadym Stetsyak wrote:
>
>>>Hello, Mark!
>
>
>>>Have you tried "DebuggerStepThroughAttribute" attribyte?
>
>
>
> MI> Hi, thanks, but that only works on functions! A Bit annoying because
> MI> it
> MI> does what I need perfectly!
>
> MI> I am toying with making my own attribute class to enable the same
> MI> functionality, but just for properties.
>
> --
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot.com

Ahh brilliant, I was placing the attribute above the property
definition, not above the getter / setter.

Thanks very much! :)

AddThis Social Bookmark Button