Tài liệu Introduction to CSharp 4.0 doc

26 715 0
Tài liệu Introduction to CSharp 4.0 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... C# Until now, C# generics have generics have been invariant been invariant C# 4.0 supports C# 4.0 supports safe co- and safe co- and contra-variance contra-variance public interface IEnumerable T> public interface IEnumerable IEnumerable public interface IEnumerator IEnumerator dynamic mapping We need to cast We need to cast ((Excel.Range)xl.Cells[1,1]).Value2 == “ID”; ((Excel.Range)xl.Cells[1,1]).Value2 “ID”; xl.Cells[1,1].Value2 = “ID”; Optional and named parameters xlChart.ChartWizard(cellRange.CurrentRegion,... y); int Compare(T x, y); }} IComparer objComp == GetComparer(); IComparer objComp GetComparer(); IComparer strComp == objComp; IComparer strComp objComp; Variance in C# 4.0 class Base {{ class Base public virtual void Foo(int xx == 4, int yy == 5) {{ public virtual void Foo(int 4, int 5) Console.WriteLine("x:{0}, y:{1}", x, y); Console.WriteLine("x:{0}, y:{1}", x, y); . class="bi x0 y0 w0 h0" alt=""

Ngày đăng: 21/01/2014, 18:20

Từ khóa liên quan

Mục lục

  • C# 4.0 Language Features

  • C# 4.0 Language

  • The Evolution of C#

  • C# 4.0 Language Innovations

  • .NET Dynamic Programming

  • Dynamically Typed Objects

  • Under the cover

  • Slide 8

  • Slide 9

  • PowerPoint Presentation

  • IDynamicObject

  • DEMO

  • Slide 13

  • Slide 14

  • Slide 15

  • Slide 16

  • Slide 17

  • Slide 18

  • Slide 19

  • Co- and Contra-variance

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan