Debugger Step Over Attribute

  • Thread starter Thread starter Mark Ingram
  • Start date Start date
M

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,
 
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
 
Vadym said:
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.
 
Hello, Mark!

IIRC there is no problem with properties.

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



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
 
Vadym said:
Hello, Mark!

IIRC there is no problem with properties.

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




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.

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

Thanks very much! :)
 
Back
Top