|
我一直在使用Visual Studio 2010RC版本。它有很多讓人欣喜的東西。下面將其列舉出來(lái):
Sequence Diagram Generation
我覺(jué)得這是一個(gè)救星。我不知道你是怎么樣的,但作為開(kāi)發(fā)人員,我在完成設(shè)計(jì)之后,就想潛心投入代碼中。通常在開(kāi)始編碼之前,有時(shí)候我想要看序列圖。現(xiàn)在,有了Visual Studio 2010序列圖生成器,我可以簡(jiǎn)單地編寫(xiě)代碼,然后生成。這不僅為您節(jié)省時(shí)間,而且讓你更好地去理解可導(dǎo)致代碼的復(fù)雜的一些分支。
以下是我在這篇文章中要使用的代碼:
1 class Animal {2 public virtual void Description() { Console.WriteLine("Lives on earth"); }
3 }
4
5 class Bird : Animal {
6 public override void Description()
7 { Console.WriteLine("have feathers and a beak"); }
8 }
9
10 class Lion : Animal {
11 public override void Description()
12 {
13 Console.WriteLine("roars and have large teeth");
14 }
15 }
16
17 class Park
18 {
19 static void Main(string[] args)
20 {
21 List<Animal> animalsInPark = new List<Animal>();
22 ShowDescriptions(animalsInPark);
23 }
24
25 static void ShowDescriptions(List<Animal> animals)
26 {
27 animals.ForEach(animal => animal.Description());
28 }
29 }
NET技術(shù):Visual Studio 2010 RC 幾個(gè)很酷的新功能,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。