首页计算机书籍计算机语言《Programming C# 5.0 Early Release》Ian Griffiths
夏木目

文档

111

关注

0

好评

0
PDF

《Programming C# 5.0 Early Release》Ian Griffiths

阅读 796 下载 0 大小 4.22M 总页数 286 页 2022-09-27 分享
价格:¥ 10.00
下载文档
/ 286
全屏查看
《Programming C# 5.0 Early Release》Ian Griffiths
还有 286 页未读 ,您可以 继续阅读 或 下载文档
1、本文档共计 286 页,下载后文档不带www.pdfdz.com水印,支持完整阅读内容。
2、古籍基本都为PDF扫描版,所以文档不支持编辑功能,即不支持文档内文字的复制粘贴。
3、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
4、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
5、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。
Building Windows 8 Metro,Web,and DesktopApplications for the NET 4.5 FrameworkProgrammingEarly ReleaseO'REILLYlan GriffithsO'Reilly Media,Inc.313/20121IntroducingC#The C#programming language(pronounced 'see sharp')can be used for ny kinds ofapplications,including web sites,desktop applications,games,phone apps,and comndline utilities.C#has been center stage for Windows developers for about a decade now,so when Microsoft announced that Windows 8 would introduce a new'style ofapplication,optimized for touch-based interaction on tablets,it was no surprise that C#was one of the four languages to offer full support from the start for these Metro styleapplications,as they're called,(the others being C++,JavaScript,and Visual Basic).Although Microsoft invented C#,the language and its runtime are documented by thestandards body ECMA,enabling anyone to implement C#.This is not merelyhypothetical.The open source Mono project at ://.mono-project/providestools for building C#applications that run on Linux,iOS and Android.Why C#?Although there are ny ways you can use C#,other languages are always an option.Why might you choose C#over these?It will depend on what you need to do,and whatyou like and dislike in a programming language.Speaking for myself,I find that C#provides considerable power and flexibility,and works at a high enough level ofabstraction that I don't expend vast amounts of effort on little details not directly relatedto the problems my programs are trying to solve.(I'm looking at you,C++.)Much of C#'s power comes from the range of programming techniques it supports.Forexample,it offers object-oriented features,generics,and functional programming.Itsupports both dynamic and static typing.It provides powerful list-and set-orientedfeatures thanks to LINQ.The most recent version of the language adds intrinsic supportfor asynchronous programming.New to Windows,at any rate.O'Reilly Media,Inc.Some of the most important benefits of using C#come from its runtime,which providesservices such as security sandboxing,runtime type checking,exception handling,threadnagement,and perhaps its most important feature,autoted memory nagement.The runtime provides a garbage collector that frees developers from much of the workassociated with recovering memory that the program is no longer using.Of course,languages do not exist in a vacuum-high quality libraries with a broad rangeof features are essential.There are some elegant and academically beautiful languagesthat are glorious right up until you want to do something prosaic such as talking to adatabase,or determining where to store user settings.No tter how strong a set ofprogramming idioms a language offers,it also needs to provide full and convenientaccess to the underlying platform's services.C#is on very strong ground here,thanks tothe NET Framework.The.NET Framework encompasses both the runtime and the libraries that C#programsuse on Windows.The runtime part is called the Common Language Runtime (usuallyabbreviated to CLR)because it supports not just C#,but any.NET language.Numerouslanguages can run in .NET.Microsoft's development environment,Visual Studio,provides Visual Basic and F#,for example,and there are open source .NET-basedimplementations of Python and Ruby (called IronPython and IronRuby).The CLR has aCommon Type System (CTS)enabling code from multiple languages to interoperatefreely,which means that.NET libraries can usually be used from any .NET language-F#can consume libraries written in .NET,C#can use Visual Basic libraries,and so on.The .NET Framework includes an extensive class library.This library provides wrappersfor ny features of the underlying operating system,but it also provides a considerableamount of functionality of its own.It contains over 10,000 classes,each with numerouembers.Some parts of the NET Framework class library are specific toWindows.There are library features dedicated to building Windowsdesktop applications,for example.However.other parts are moregeneric,such as the HTTP client classes,which would be relevant onany operating system.The ECMA specification for the runtime used byC#defines a set of library features which are not dependent on anyparticular operating system.The .NET Framework class librarysupports all these features of course,as well as offering Microsoft-specific ones.The libraries built into the framework are not the whole story-ny other frameworksprovide their own .NET class libraries.SharePoint has an extensive .NET APL,forexample.And of course,libraries do not have to be associated with frameworks.There'sa large ecosystem of.NET libraries,some commercial and some free and open source.There are thetical utilities,parsing libraries,and user intece components to namejust a few.Even if you get unlucky and need to use an OS feature that doesn't have any NET librarywrappers,C#offers various mechanis for working with older style APIs such asWin32 and COM.Some aspects of the interoperability mechanis are a little clunky,and if you need to deal with an existing component,you might need to write a thinwrapper that presents a more.NET-friendly face.(You can still write the wrapper in C#.You'd just be putting the awkward interop details in one place,rather than letting thempollute your whole codebase.)However,if you design a new COM component carefully,you can ke it straightforward to use directly from C#.Windows 8 introduces a new2
返回顶部