TAILIEUCHUNG - Essential C# 3.0 FOR NET FRAMEWORK 3.5 PHẦN 7

Sử dụng đệ quy, PrintNode () chức năng chứng minh rằng một cây biểu hiện là một cây số không hay nhiều cây biểu. Các cây biểu có được lưu trữ trong thuộc tính cơ thể của một biểu thức. Ngoài ra, các cây bao gồm cả một tài sản ExpressionType gọi là NodeType nơi ExpressionType là một enum đối với từng loại khác nhau của biểu. | Summary 4TÌ Using recursion the PrintNode function demonstrates that an expression tree is a tree of zero or more expression trees. The contained expression trees are stored in an Expression s Body property. In addition the expression tree includes an ExpressionType property called NodeType where ExpressionType is an enum for each different type of expression. There are numerous types of expressions BinaryExpression ConditionalExpression LambdaExpression the root of an expression tree MethodCallExpression ParameterExpression and ConstantExpression are examples. Each type derives from .Expression. Generally you can use statement lambdas interchangeably with expression lambdas. However you cannot convert statement lambdas into expression trees. You can express expression trees only by using expression lambda syntax. SUMMARY This chapter began with a discussion of delegates and their use as references to methods or callbacks. It introduced a powerful concept for passing a set of instructions to call in a different location rather than immediately when the instructions are coded. Following on the heels of a brief look at the C concept of anonymous methods the chapter introduced the C concept of lambda expressions a syntax that supersedes although doesn t eliminate the C anonymous method syntax. Regardless of the syntax these constructs allow programmers to assign a set of instructions to a variable directly without defining an explicit method that contains the instructions. This provides significant flexibility for programming instructions dynamically within the method a powerful concept that greatly simplifies the programming of collections through an API known as LINQ for language integrated query. Finally the chapter ended with the concept of expression trees and how they compile into data that represents a lambda expression rather than the delegate implementation itself. This is a key feature that enables such libraries as LINQ .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.