官术网_书友最值得收藏!

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);
主站蜘蛛池模板: 宣城市| 江源县| 应用必备| 玛曲县| 铜鼓县| 安平县| 靖西县| 托克逊县| 扎鲁特旗| 大悟县| 中阳县| 增城市| 法库县| 湛江市| 沙雅县| 巍山| 吴川市| 澄江县| 焉耆| 进贤县| 巴南区| 加查县| 法库县| 深圳市| 绿春县| 隆子县| 灵宝市| 乐安县| 太仆寺旗| 乌恰县| 达州市| 衡阳市| 资溪县| 大石桥市| 宽甸| 达孜县| 广元市| 怀远县| 平武县| 安平县| 资中县|