Join Anton Delsink for an in-depth discussion in this video Keyword using, part of Object Oriented Programming with C#.
- This very common pattern that we've now seen of,…using a try finally block to make sure we release resources,…is so common that there is support…in the .NET Framework for this pattern.…And the support comes in the form of an interface…called IDisposable.…So watch this.…I will copy and paste the whole method.…Rename the method to number 12.…And what you will notice is fs, way up here..…
This FileStream implements the interface called IDisposable.…I will press Ctrl dot, so we add the using statement…at the top using system.…So this variable of type IDisposable,…is special in a number of ways,…but, first, how do I know FileStream…implements IDisposable?…Click on the name of the type and you can press F12,…we could use the proper shortcut to go to definition.…And so, what happens is .NET looks at the class definition…and writes out, in-text,…what it sees when it looks at…the underlined definitions, at the method data.…
And so, FileStream is inheriting from Stream, okay.…So let Stream, press F12 or go to definition,…
- Abstract classes
- Processing text with StreamReader
- IEnumerable and yield return
- Windows Forms controls
- Windows Forms with and without the designer
- Adding, organizing, and testing forms
- Creating classes
Skill Level Intermediate
What you should know1m 10s
1. Theory vs. Practice
2. Examples from .NET
3. Examples from Windows UI
4. Examples from Board Games
5. Examples from the Web
Next steps1m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.