Auto-Implemented Properties in Visual Basic 2010
- Posted: Jun 12, 2009 at 2:36 PM
- 15,566 Views
- 7 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- MP4 (iPod, Zune HD)
- Mid Quality WMV (Lo-band, Mobile)
Kathleen McGrath
Visual Studio User Education
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
The demo keeps asking to install Silverlight, even I have it installed. I clicked to install it again, but I still keep getting the prompt to install it. Running Vista Ultimate - latest updates.
Are you able to view other Silverlight videos on Channel 9? Alternatively, you can view it in Windows Media Player by clicking Formats and then clicking WMV (high)
I think this is a great feature in Visual Basic because you will really save lots of code and it will be very easy to replace an auto implemented property with a normal property afterwards (adding additional checks and cleanup work for setters, or implementing extra logic for getters if you change the field).
There is only one problem:
Very often it is better to access fields directly because you want to bypass any validation checks that my be implemented in the property someday. An example for this is the constructor where you do not have valid data yet or some other situations.
It is also good for readabilty of Code if you have your global Fields of a Class starting with a "_", while local variables in a function do not have it.
I have seen you can access the private fields directly very nicely, but there is no intellisense support for this. If you type Me._Last in the construtor there is no entry for Me._Lastname.
Isnt't the backing variable declared incorectly and violating the .Net framework guildlines that have been in use for many many years? I thought all variables should be pascal case, aka, the first character should always be lower case.
I.e for a property named CustermerID the backing variable should be _customerID NOT _CustomerID. The ONLY time words .net should start uppercase are Properties, Events, Classes, Delegates etc.
The feature just prepends an underscore onto whatever name you give the property. It doesn't modify any of the casing for the property name itself. Hence, you'll get backing variable casing that does not match the framework naming guidelines. --Doug
Does it have affect on performance ??
Auto-Implemented property vs Normal Property
What is the difference between a plain field and an auto-implemented property? Why would you choose one over the other?
Remove this comment
Remove this thread
close