你排放多少温室气体?

在MSN赞助的今年LiveEarth活动中,Conservation International发布了基于MOSS 2007新网站,作为阻止温室气体排放的努力,他们发表了一个二氧化碳排放量计算器,当然,这是基于Silverlight的应用:
<www.biodiversityhotspots.org/CarbonCalculator/Pages/Donate.aspx>

这个计算器根据你家庭的人口、交通、饮食状况,计算出你每年向大气层排放多少吨温室气体,引起你的思考,或者捐款,它还附有一个相关题材的小相册,所有数据都从MOSS 2007中调用。另外在旁边“探索马达加斯加”功能中,展示了他们拯救雨林的项目,在这里,Silverlight调用Virtual Earth服务来显示地理信息。

下面播报一些项目细节:

Some Details

  • Two developers, two months doing everything on the project except for coming up with the specific language to show up on the screens 
  • Almost all test descriptions and calculator data is served up from various MOSS (SharePoint) lists
  • All filmstrip images come from MOSS
  • All videos are served up from MOSS
  • The geodata for the map points is also served up from MOSS
  • Silverlight is sitting over a layer holding the Virtual Earth map. We show and hide that layer as necessary. The shapes are placed on the map by converting lat/long data into real Silverlight coordinates.
  • The calculator itself is hosted in a regular old html page and surfaced via a page viewer web part (iframe) in a SharePoint page. This eliminated having to tackle building a web part on such a short project.
  • We couldn't pop up web pages using Silverlight, as popup blockers aren't yet aware of it like they are Flash. For that reason, the donation process takes over the iframe. This is far from ideal, but the best approach for now, as the donation pages change regularly.

Code Metrics

VS Analyzer doesn't yet understand agclr-hosted assemblies, so I did a quick count of files by hand  (good old DIR /S), ignoring the test projects

  • The UI layer project has 87 XAML files, 93 .cs files and 5 .js files, not counting the sample silverlight controls I modified
  • The business layer project has 28 .cs files
  • The web service layer project has 38 .cs files and 2 .asmx files

Tools Used

  • Visual Studio Orcas Beta 1 for all development, and some xaml tweaking
  • Expression Blend 2 Beta for main UI design and some of the animations
  • Expression Design RTM for all vector graphics (everything in the UI except the backgrounds)
  • Expression Media Encoder Beta for the videos
  • Corel Paint Shop Pro Photo for raster graphics (I'll graduate to PhotoShop CS some day!)

来自:<community.irritatedvowel.com/blogs/pete_browns_blog/archive/2007/07/07/Silverlight-1.1-Carbon-Offset-Calculator-is-out_2100_.aspx>