Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Debugger Step Over Attribute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Ingram - 20 Nov 2006 15:22 GMT
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,
Vadym Stetsyak - 20 Nov 2006 15:41 GMT
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
Mark Ingram - 20 Nov 2006 17:12 GMT
> 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.
Vadym Stetsyak - 21 Nov 2006 07:38 GMT
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
Mark Ingram - 21 Nov 2006 10:50 GMT
> Hello, Mark!
>
[quoted text clipped - 23 lines]
> 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! :)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.