C# v2.0 - Visual Studio 2005
These are most useful when used with container types such as lists, vectors, hash tables etc
Generics can treat the types that they contain specifically by their type rather than by using the object base type.
Allows you to create open-ended types that are converted to close types at runtime.
In C# you usually use foreach to iterate through a collection
This collection must implement the IEnumerable interface
This interface includes the GetEnumerator method which is often very tedious to implement
A new construct called an iterator block has been added to simplify this.
Collections > Iterators
Also known as a lambda function
These are very useful when used with delegates and events
Delegates and events are used to register callback methods that are linked to specific methods somewhere
Anonymous methods allow you to define the delegate or events code inline
The anonymous method body also has access to all the variables that are currently is scope
This has however been superseded by Lambda Expressions introduced in C# 3.0.
Prioir to C# 2.0 you had to define each class entirely in a single file
Automatically generated code can now live in a different file which prevents this code from being accidentally modified
The following line of code does not seem to work if you want to change the selected tab after the tab order has been fixed in the Form_Load event.
Me.tabWizard.SelectedIndex = 2
This line of code seems to work though
Me.tabWizard.SelectedTab = Me.tabWizard.TabPages(2)
The default mechanism for passing arguments was changed from ByRef to ByVal
No longer need to use the Set keyword to initialise and set objects
Call is not required but is still supported for backwards compatibility
© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext