- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 146字
- 2021-07-02 15:29:19
Entering the reference code
Now, I'll do my reference code. This code is mechanical. There's a lot of it, but it's mechanical. Remember, the big idea here is that IComparable is being implemented using the CompareTo method inside the Quad class, which means that now when we stick different shapes into a list of quads, we will be able to sort them in some fashion. So, now our names will be sorted. In our case, we'll be sorting them by name.
Now go to Default.aspx, and enter the Design view. Double-click on the Sort and Show button. This takes us into Default.aspx.cs. Delete the Page_Load block.
Next, between the set of curly braces under the line beginning with protected void Button1_Click..., the first thing we'll do is to put a Quad on the left-hand side and we'll call it sqr:
Quad sqr = new Square("Square", 4);
- Android Wearable Programming
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Qt 5 and OpenCV 4 Computer Vision Projects
- PHP 7底層設計與源碼實現
- jQuery EasyUI網站開發實戰
- Java游戲服務器架構實戰
- Mastering Python Networking
- 琢石成器:Windows環境下32位匯編語言程序設計
- 軟件品質之完美管理:實戰經典
- Natural Language Processing with Java and LingPipe Cookbook
- ASP.NET程序開發范例寶典
- Red Hat Enterprise Linux Troubleshooting Guide
- Simulation for Data Science with R
- Groovy 2 Cookbook
- Neo4j Graph Data Modeling