Overview of Visual Basic 9.0 cutting-edge broadcast content

Source: Internet
Author: User
I am going to start the Visual Basic 9.0 cutting-edge broadcast at the blog Hall and other visitors. The content covers all the new language features and the combination of related XLinq/DLinq apis under the current design of VB9. The following is the Content preview

Static
I. Prediction of local variable types and array Initiators
Dim a = 5
Dim arr = {1, 2, 3}

Ii. Object initializer and anonymous type
Dim a = New Employee {. Name = "Jack",. Age = 27}
Dim B = New {. Date = Now,. Quantity = 1000}
Dim d = New List (Of String) {"a", "B", "cc "}

Iii. Extension methods
<Extension> Function Where (Of T) ([Me] As IEnumerable (Of T), predicate As Func (Of T, Boolean) As Query (Of T)

4. Embedded functions and Closure.
Sub
Sub B: End Sub
End Sub

V. Query Comprehension
Dim result = Select c. Name, C. Age From c In mers MERs Where c. ID> 10500

6. Relaxed Delegation

VII. Empty type
Dim I? As Integer = Nothing

Dynamic
I. Dynamic identifier
Dim prop = "Length"
Dim str = "abc"
Dim I As Integer = str. (prop)

Ii. Dynamic Interface (strong Type Duck Type)
Dynamic Interface IHasLength
ReadOnly Property Length As Integer
End Interface

Dims = "1234"
Dim ihl As IHasLength = s
Dim I = ihl. Length

Iii. XML literal
Dim x = <Root> <productid = "123"> Description </Product> </Root>

Iv. Later binding of XML
Dim y As String = x. Root. Product. @ Id

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.