Transcription of C Sharp Programming - kau
1 C Sharp ProgrammingC Sharp Book Is Generated ByWikiTypeusingRenderX DiType, XML to PDF XSL-FO FormatterPermission is granted to copy, distribute and/or modify this document under the terms of the GNUFree Documentation License, Version or any later version published by the Free SoftwareFoundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy ofthe license is included in the section entitled"GNU Free Documentation License".12 June 2008 Table of Contents1. C Sharp .. 12 Language Basics.. 13 Classes.. 13 The .NET Framework.. 14 Advanced Object-Orientation Concepts.. 14 Keywords.. 15 External links.
2 162.. 173.. 184.. 195. The .NET .NET Framework.. 20 Console Programming .. 21 Output.. 21 Input.. 22 Error.. 22 Command line arguments.. 23 Windows .. 267. Sharp Programming - 3 -by , XML to PDF XSL-FO FormatterIntroduction.. 28 Standard.. 29 History.. 299.. 33 Conventions.. 33 Namespace.. 33 Assemblies.. 34 Classes and Structures.. 34 Exception Classes.. 34 Interfaces.. 34 Functions.. 34 Properties and Public Member Variables.. 34 Parameters and Procedure-level Variables.. 35 Class-level Private and Protected Variables.. 35 Controls on Forms.. 35 Constants.. 35 Example.. 3511.. 37 Statement blocks.. 38 Comments.
3 39 Case sensitivity.. 4012. , Local Variables, and Parameters.. 41 Fields.. 42 Local variables.. 42 Parameter.. 42C Sharp Programming - 4 -by , XML to PDF XSL-FO FormatterTypes.. 43 Integral types.. 43 Custom types.. 47 Conversion.. 48 Scope and extent.. 4813.. 49 Logical.. 50 Bitwise shifting.. 52 Relational.. 52 Assignment.. 53 Short-hand Assignment.. 54 Type information.. 55 Pointer manipulation.. 55 Overflow exception control.. 56 Others.. 5614. Data .. 57 Structs.. 58 Arrays.. 6015. statements.. 62 The if statement.. 62 The switch statement.. 63 Iteration statements.. 65 The loop.. 65 The for loop.. 66 The foreach loop.
4 67 The while loop.. 67C Sharp Programming - 5 -by , XML to PDF XSL-FO FormatterJump statements.. 6816.. 7117. namespaces.. 7318.. 76 Constructors.. 76 Finalizers.. 78 Properties.. 79 Indexers.. 80 Events.. 80 Operator.. 81 Structures.. 81 Static classes.. 8219.. 83 Reference and Value Types.. 85 Object basics.. 85 Constructors.. 85 Destructors.. 88 Abstract Class.. 89 Sub-heading.. 8920. Levels.. 91 Private.. 91 Protected.. 91 Public.. 91C Sharp Programming - 6 -by , XML to PDF XSL-FO FormatterInternal.. 9121. NET Framework .. 92 Background.. 9322.. 94 Subtyping Inheritance.. 94 Inheritance keywords.. 9623. Details.
5 9924. Delegates and .. 100 Delegates.. 101 Events.. 10325. Abstract Partial Classes.. 10827.. 110 LinkedLists.. 110 Queues.. 110 Stacks.. 111 Dictionaries.. 11128. Interfaces.. 112 Generic Classes.. 112 Generic lists.. 115 Generic linked lists.. 117 Generic queues.. 117C Sharp Programming - 7 -by , XML to PDF XSL-FO FormatterGeneric stacks.. 117 Generic dictionaries.. 117 Generic Methods.. 117 Generic Delegates.. 117 Generic Events.. 11729. Object .. 118 Garbage Collector.. 118 Managed Resources.. 119 Unmanaged Resources.. 119 Applications.. 120 Resource Acquisition Is Initialisation.. 12230. Design Of Contents (TOC).
6 123 Factory Pattern.. 123 Singleton.. 12631. also.. 12933. Sharp Programming - 8 -by , XML to PDF XSL-FO Formatter43.. 150 Keyword.. 15152.. 163 Keyword.. 16362. Sharp Programming - 9 -by , XML to PDF XSL-FO Formatter68. Sharp Programming - 10-by , XML to PDF XSL-FO Formatter97. directive.. 207 The statement.. 208101. Free Documentation License..219C Sharp Programming - 11 -by , XML to PDF XSL-FO FormatterC Sharp Programming |Introduction|Basics|Classes| The .NET Framework|Advanced Topics|IndexC Sharp musical noteC#(pronounced "See Sharp ") is a multi-purpose computerprogramming languagesuitablefor all development needs.
7 This WikiBook introduces C# language fundamentals and covers avariety of the base class libraries (BCL) provided by the Microsoft .NET introduction:C Sharp Programming /ForewordAlthough C# is derived from theC Programming language, it has features such asgarbagecollectionthat allow beginners to become proficient in C# more quickly than inCorC++. SimilartoJava, it isobject-oriented, comes with an extensiveclass library, and supports exception han-dling, multiple types ofpolymorphism, and separation of interfaces from implementations. Thosefeatures, combined with its powerful development tools, multi-platform support, andgenerics,make C# a good choice for many types of software development projects:rapid application devel-opmentprojects, projects implemented by individuals or large or small teams, Internet applica-tions, and projects with strict reliability requirements.
8 Testing frameworks such asNUnitmakeC# amenable totest-driven developmentand thus a good language for use withExtreme Program-ming(XP). Itsstrong typinghelps to prevent many Programming errors that are common inweakly typed description of the C# language and introduction to this Sharp Programming - 12-by , XML to PDF XSL-FO FormatterGetting started with C#A simple C# program and where to get tools to compile BasicsNaming conventionsQuickly describes the generally accepted naming conventions for C#.Basic syntaxDescribes the basics in how the applications you write will be entities used to store data of various the operators, such as the '+' in addition, available in C#.
9 Data structuresEnumerations, structs, and statementsLoops, conditions, and more. How the program flow is to errors that can your code its own space to live blueprints of objects that describes how they should Sharp Programming - 13 -by , XML to PDF XSL-FO FormatterObjectsCornerstones of any object-oriented Programming language, objects are the tools you useto perform and accessor levelsExplains protection of object states .NET Framework OverviewAn overview of the .NET class library used in C#.Console ProgrammingInput and Output using the FormsGUI Programming with Windows Object-Orientation ConceptsInheritanceRe-using existing code to improve or specialise the functionality of an a template, in which to base sub-classes and EventsBe informed about when an event happens and choose what method to call when it happenswith classesBuild partially implemented classesSplit a class over several files to allow multiple users to develop, but also to stop codegenerators interfering with source Sharp Programming - 14-by , XML to PDF XSL-FO FormatterCollectionsEffectively manage (add, remove, find, iterate, etc.)
10 Large sets of commonly used collections and classes to appear to have specialisation for yourcustom LifetimeLearn about the lifetime of objects, where they are allocated and learn about garbage PatternsLearn commonly used design methodologies to simplify and/or improve your Sharp Programming - 15 -by , XML to PDF XSL-FO FormatterExternal links Learning Visual C# in 5 minutesA simple tutorial that teaches you a few basics. A C# Tutorialstarts from basics and gives source code. An Introduction to Mono Developmentby Andrew Troelsen Sharp Develop IDE: A free IDE for C#, and Boo projects on Microsoft' platform. Microsoft Visual C# Express Edition: A free development environment created byMicrosoft for writing C# Applications.