Results 1 to 3 of 3

Thread: Shared variables, properties and events

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Shared variables, properties and events

    Hi, I am just reading up about using shared variables, properties and events when creating classes in .NET.

    The book shows me how do to this but I would like to be given some real life examples of when and why I would make a variable shared..

    The basic example they give is a shared variable counter that displays how many objects you have created from a given class.

    That's all very nice but a pretty lame example I think. What else would I use a shared variable for when defining a class??

    Thanks
    Mark

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The purpose of using Shared scope is when the member doesn't relate to an instance. So use it with anything that doesn't require an instance of the object.
    Last edited by Edneeis; Mar 14th, 2004 at 04:20 AM.

  3. #3

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Smile

    Thanks for your help Edneeis
    Cheers
    MarkusJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width