C# 10.0 All-in-One For Dummies

C# 10.0 All-in-One For Dummies

1. Aufl.

von: John Paul Mueller

32,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 24.01.2022
ISBN/EAN: 9781119839088
Sprache: englisch
Anzahl Seiten: 864

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.


<b>Look sharp—learn or refresh your C# skills with the latest version</b> <p>C# is one of the most popular programming languages, and frequent updates help it keep pace as the world of coding changes. You can keep pace too, thanks to <i>C# 10.0 All-in-One For Dummies,</i> where you'll learn the basics of the language itself, how to code in Visual Studio, and how to take advantage of the new features in the latest release. At every stage of your career, you'll need to know the cutting-edge trends and techniques that clients want. This book has your back, with info on object-oriented programming, writing secure code, building web applications, and more. <p>The six standalone mini-books you'll find inside this all-in-one will take you through the changes to C# and the practical applications and dev tools that you need to know. New features covered include records, init only setters, top-level statements, pattern matching enhancements, fit and finish features, and a lot more. Plus, this version is packed with more examples and code snippets, so you can sharply see C# in action! <ul> <li>Learn the very basics of C# programming, even if you have no prior experience</li> <li>Refresh your knowledge of the language and learn how to use the new features in the 10.0 version release</li> <li>Read six mini-books on hot coding topics like object-oriented programming, Visual Studio, and Windows 10 development</li> <li>Enhance your employability and join the 6.5-million-strong community of C# developers</li> </ul> <p>You need an easy-to-read C# guide that will help you understand the incoming updates, and this <i>For Dummies</i> reference is it.
<p><b>Introduction</b> 1</p> <p>About This Book 1</p> <p>Foolish Assumptions 2</p> <p>Icons Used in This Book 3</p> <p>Beyond the Book 3</p> <p>Where to Go from Here 4</p> <p><b>Book 1: The Basics of C# Programming</b><b> 5</b></p> <p><b>Chapter 1: Creating Your First C# Console Application</b><b> 7</b></p> <p>Getting a Handle on Computer Languages, C#, and NET 8</p> <p>What’s a program? 8</p> <p>What’s C#? 9</p> <p>What’s NET? 9</p> <p>What is Visual Studio 2022? 10</p> <p>Creating Your First Console Application 11</p> <p>Creating the source program 11</p> <p>Taking it out for a test drive 17</p> <p>Making Your Console App Do Something 17</p> <p>Reviewing Your Console Application 18</p> <p>The program framework 19</p> <p>Comments 19</p> <p>The meat of the program 19</p> <p>Replacing All that Ceremonial Code: Top-Level Statements 20</p> <p>Introducing the Toolbox Trick 21</p> <p>Saving code in the Toolbox 22</p> <p>Reusing code from the Toolbox 22</p> <p>Interacting with C# Online 23</p> <p>Working with Jupyter Notebook: The Short Version 23</p> <p><b>Chapter 2: Living with Variability — Declaring Value-Type Variables</b><b> 25</b></p> <p>Declaring a Variable 26</p> <p>What’s an int? 27</p> <p>Rules for declaring variables 28</p> <p>Variations on a theme: Different types of int 28</p> <p>Representing Fractions 30</p> <p>Handling Floating-Point Variables 31</p> <p>Declaring a floating-point variable 31</p> <p>Examining some limitations of floating-point variables 32</p> <p>Using the Decimal Type: Is It an Integer or a Float? 34</p> <p>Declaring a decimal 35</p> <p>Comparing decimals, integers, and floating-point types 35</p> <p>Examining the bool Type: Is It Logical? 36</p> <p>Checking Out Character Types 36</p> <p>The char variable type 36</p> <p>Special chars 37</p> <p>The string type 37</p> <p>What’s a Value Type? 39</p> <p>Comparing string and char 40</p> <p>Calculating Leap Years: DateTime 41</p> <p>Declaring Numeric Constants 43</p> <p>Changing Types: The Cast 44</p> <p>Letting the C# Compiler Infer Data Types 46</p> <p><b>Chapter 3: Pulling Strings</b><b> 49</b></p> <p>The Union Is Indivisible, and So Are Strings 50</p> <p>Performing Common Operations on a String 51</p> <p>Comparing Strings 52</p> <p>Equality for all strings: The Compare() method 52</p> <p>Would you like your compares with or without case? 56</p> <p>What If I Want to Switch Case? 56</p> <p>Distinguishing between all-uppercase and all-lowercase strings 56</p> <p>Converting a string to upper- or lowercase 57</p> <p>Looping through a String 58</p> <p>Searching Strings 59</p> <p>Can I find it? 59</p> <p>Is my string empty? 60</p> <p>Using advanced pattern matching 60</p> <p>Getting Input from Users in Console Applications 61</p> <p>Trimming excess white space 62</p> <p>Parsing numeric input 62</p> <p>Handling a series of numbers 64</p> <p>Joining an array of strings into one string 66</p> <p>Controlling Output Manually 67</p> <p>Using the Trim() and Pad() methods 67</p> <p>Using the Concatenate() method 69</p> <p>Go Ahead and Split() that concatenate program 71</p> <p>Formatting Your Strings Precisely 72</p> <p>Using the String.Format() method 72</p> <p>Using the interpolation method 77</p> <p>StringBuilder: Manipulating Strings More Efficiently 77</p> <p><b>Chapter 4: Smooth Operators</b><b> 81</b></p> <p>Performing Arithmetic 81</p> <p>Simple operators 82</p> <p>Operating orders 82</p> <p>The assignment operator 84</p> <p>The increment operator 84</p> <p>Performing Logical Comparisons — Is That Logical? 85</p> <p>Comparing floating-point numbers: Is your float bigger than mine? 86</p> <p>Compounding the confusion with compound logical operations 87</p> <p>Matching Expression Types at 89</p> <p>Calculating the type of an operation 89</p> <p>Assigning types 91</p> <p>Changing how an operator works: Operator overloading 92</p> <p><b>Chapter 5: Getting into the Program Flow</b><b> 95</b></p> <p>Branching Out with if and switch 96</p> <p>Introducing the if statement 97</p> <p>Examining the else statement 100</p> <p>Avoiding even the else 101</p> <p>Nesting if statements 102</p> <p>Running the switchboard 104</p> <p>Here We Go Loop-the-Loop 110</p> <p>Looping for a while 111</p> <p>Doing the do while loop 114</p> <p>Breaking up is easy to do 115</p> <p>Looping until you get it right 116</p> <p>Focusing on scope rules 120</p> <p>Looping a Specified Number of Times with for 120</p> <p>A for loop example 121</p> <p>Why do you need another loop? 122</p> <p>Nesting loops 123</p> <p><b>Chapter 6: Lining Up Your Ducks with Collections</b><b> 125</b></p> <p>The C# Array 126</p> <p>The argument for the array 126</p> <p>The fixed-value array 127</p> <p>The variable-length array 129</p> <p>Initializing an array 132</p> <p>Processing Arrays by Using foreach 133</p> <p>Working with foreach loops in a standard way 133</p> <p>Relying on GetEnumerator support 134</p> <p>Sorting Arrays of Data 136</p> <p>Using var for Arrays 139</p> <p>Loosening Up with C# Collections 140</p> <p>Understanding Collection Syntax 141</p> <p>Figuring out <T> 142</p> <p>Going generic 142</p> <p>Using Lists 143</p> <p>Instantiating an empty list 143</p> <p>Creating a list of type int 144</p> <p>Converting between lists and arrays 144</p> <p>Searching lists 144</p> <p>Performing other list tasks 145</p> <p>Using Dictionaries 145</p> <p>Creating a dictionary 145</p> <p>Searching a dictionary 146</p> <p>Iterating a dictionary 146</p> <p>Array and Collection Initializers 147</p> <p>Initializing arrays 148</p> <p>Initializing collections 148</p> <p>Using Sets 149</p> <p>Performing special set tasks 149</p> <p>Creating a set 150</p> <p>Adding items to a set 150</p> <p>Performing a union 151</p> <p>Performing an intersection 152</p> <p>Performing a difference 153</p> <p><b>Chapter 7: Stepping through Collections</b><b> 155</b></p> <p>Iterating through a Directory of Files 156</p> <p>Using the LoopThroughFiles program 156</p> <p>Getting started 157</p> <p>Obtaining the initial input 157</p> <p>Creating a list of files 159</p> <p>Formatting the output lines 160</p> <p>Displaying the hexadecimal output 161</p> <p>Running from inside Visual Studio 163</p> <p>Iterating foreach Collections: Iterators 164</p> <p>Accessing a collection: The general problem 164</p> <p>Letting C# access data foreach container 167</p> <p>Accessing Collections the Array Way: Indexers 169</p> <p>Indexer format 169</p> <p>An indexer program example 170</p> <p>Looping Around the Iterator Block 173</p> <p>Creating the required iterator block framework 174</p> <p>Iterating days of the month: A first example 176</p> <p>What a collection is, really 177</p> <p>Iterator syntax gives up so easily 178</p> <p>Iterator blocks of all shapes and sizes 180</p> <p><b>Chapter 8: Buying Generic</b><b> 187</b></p> <p>Writing a New Prescription: Generics 188</p> <p>Generics are type-safe 188</p> <p>Generics are efficient 189</p> <p>Classy Generics: Writing Your Own 190</p> <p>Shipping packages at OOPs 190</p> <p>Queuing at OOPs: PriorityQueue 191</p> <p>Unwrapping the package 194</p> <p>Touring Main() 196</p> <p>Writing generic code the easy way 197</p> <p>Saving PriorityQueue for last 198</p> <p>Using a (nongeneric) Simple Factory class 201</p> <p>Understanding Variance in Generics 205</p> <p>Contravariance 206</p> <p>Covariance 208</p> <p><b>Chapter 9: Some Exceptional Exceptions</b><b> 209</b></p> <p>Using an Exceptional Error-Reporting Mechanism 210</p> <p>About try blocks 211</p> <p>About catch blocks 211</p> <p>About finally blocks 212</p> <p>What happens when an exception is thrown 213</p> <p>Throwing Exceptions Yourself 215</p> <p>Can I Get an Exceptional Example? 216</p> <p>Working with Custom Exceptions 220</p> <p>Planning Your Exception-Handling Strategy 221</p> <p>Some questions to guide your planning 221</p> <p>Guidelines for code that handles errors well 222</p> <p>How to find out which methods throw which exceptions 223</p> <p>Grabbing Your Last Chance to Catch an Exception 225</p> <p>Throwing Expressions 226</p> <p><b>Chapter 10: Creating Lists of Items with Enumerations</b><b> 229</b></p> <p>Seeing Enumerations in the Real World 230</p> <p>Working with Enumerations 231</p> <p>Using the enum keyword 231</p> <p>Creating enumerations with initializers 233</p> <p>Specifying an enumeration data type 234</p> <p>Creating Enumerated Flags 235</p> <p>Defining Enumerated Switches 237</p> <p>Working with Enumeration Methods 238</p> <p><b>Book 2: Object-Oriented C# Programming</b><b> 241</b></p> <p><b>Chapter 1: Showing Some Class</b><b> 243</b></p> <p>A Quick Overview of Object-Oriented Programming 244</p> <p>Considering OOP basics 244</p> <p>Extending classes to meet other needs 244</p> <p>Keeping objects safe 245</p> <p>Working with objects 246</p> <p>Defining a Class and an Object 246</p> <p>Defining a class 247</p> <p>What’s the object? 249</p> <p>Accessing the Members of an Object 250</p> <p>Working with Object-Based Code 250</p> <p>Using the traditional approach 250</p> <p>Using the C# 9.0 approach 252</p> <p>Discriminating between Objects 253</p> <p>Can You Give Me References? 254</p> <p>Classes That Contain Classes Are the Happiest Classes in the World 256</p> <p>Generating Static in Class Members 257</p> <p>Defining const and readonly Data Members 259</p> <p><b>Chapter 2: We Have Our Methods</b><b> 261</b></p> <p>Defining and Using a Method 262</p> <p>Method Examples for Your Files 263</p> <p>Understanding the problem 264</p> <p>Working with standard coding methods 265</p> <p>Applying a refactoring approach 268</p> <p>Working with local functions 271</p> <p>Having Arguments with Methods 273</p> <p>Passing an argument to a method 273</p> <p>Passing multiple arguments to methods 274</p> <p>Matching argument definitions with usage 276</p> <p>Overloading a method doesn’t mean giving it too much to do 276</p> <p>Implementing default arguments 278</p> <p>Using the Call-by-Reference Feature 280</p> <p>Defining a Method with No Return Value 281</p> <p>Returning Multiple Values Using Tuples 282</p> <p>Using a tuple 283</p> <p>Relying on the Create() method 284</p> <p>Creating tuples with more than two items 284</p> <p><b>Chapter 3: Let Me Say This about this</b><b> 287</b></p> <p>Passing an Object to a Method 288</p> <p>Comparing Static and Instance Methods 290</p> <p>Employing static properties and methods effectively 291</p> <p>Employing instance properties and methods effectively 293</p> <p>Expanding a method’s full name 295</p> <p>Accessing the Current Object 296</p> <p>What is the this keyword? 298</p> <p>When is the this keyword explicit? 299</p> <p>Using Local Functions 300</p> <p>Creating a basic local function 300</p> <p>Using attributes with local functions 301</p> <p><b>Chapter 4: Holding a Class Responsible</b><b> 303</b></p> <p>Restricting Access to Class Members 303</p> <p>A public example of public BankAccount 304</p> <p>Jumping ahead — other levels of security 306</p> <p>Why You Should Worry about Access Control 307</p> <p>Accessor methods 308</p> <p>Working with init-only setters 309</p> <p>Access control to the rescue — an example 311</p> <p>Defining Class Properties 313</p> <p>Static properties 315</p> <p>Properties with side effects 315</p> <p>Accessors with access levels 316</p> <p>Using Target Typing for Your Convenience 316</p> <p>Dealing with Covariant Return Types 319</p> <p>Getting Your Objects Off to a Good Start — Constructors 320</p> <p>The C#-Provided Constructor 321</p> <p>Replacing the Default Constructor 322</p> <p>Constructing something 324</p> <p>Initializing an object directly with an initializer 326</p> <p>Seeing that construction stuff with initializers 326</p> <p>Initializing an object without a constructor 327</p> <p>Using Expression-Bodied Members 329</p> <p>Creating expression-bodied methods 329</p> <p>Defining expression-bodied properties 329</p> <p>Defining expression-bodied constructors and destructors 330</p> <p>Defining expression-bodied property accessors 330</p> <p>Defining expression-bodied event accessors 331</p> <p><b>Chapter 5: Inheritance: Is That All I Get?</b><b> 333</b></p> <p>Why You Need Inheritance 334</p> <p>Inheriting from a BankAccount Class (a More Complex Example) 335</p> <p>Working with the basic update 336</p> <p>Tracking the BankAccount and SavingsAccount classes features 339</p> <p>IS_A versus HAS_A — I’m So Confused_A 342</p> <p>The IS_A relationship 342</p> <p>Gaining access to BankAccount by using containment 343</p> <p>The HAS_A relationship 345</p> <p>When to IS_A and When to HAS_A 346</p> <p>Other Features That Support Inheritance 346</p> <p>Substitutable classes 346</p> <p>Invalid casts at runtime 347</p> <p>Avoiding invalid conversions with the is operator 348</p> <p>Avoiding invalid conversions with the as operator 349</p> <p><b>Chapter 6: Poly-what-ism?</b><b> 353</b></p> <p>Overloading an Inherited Method 354</p> <p>It’s a simple case of method overloading 354</p> <p>Different class, different method 355</p> <p>Peek-a-boo — hiding a base class method 355</p> <p>Polymorphism 361</p> <p>Using the declared type every time (Is that so wrong?) 362</p> <p>Using is to access a hidden method polymorphically 364</p> <p>Declaring a method virtual and overriding it 365</p> <p>Getting the most benefit from polymorphism 368</p> <p>C# During Its Abstract Period 368</p> <p>Class factoring 369</p> <p>The abstract class: Left with nothing but a concept 373</p> <p>How do you use an abstract class? 374</p> <p>Creating an abstract object — not! 377</p> <p>Sealing a Class 377</p> <p><b>Chapter 7: Interfacing with the Interface</b><b> 379</b></p> <p>Introducing CAN_BE_USED_AS 379</p> <p>Knowing What an Interface Is 381</p> <p>How to implement an interface 382</p> <p>Using the newer C# 8.0 additions 383</p> <p>How to name your interface 386</p> <p>Why C# includes interfaces 386</p> <p>Mixing inheritance and interface implementation 387</p> <p>And he-e-e-re’s the payoff 387</p> <p>Using an Interface 388</p> <p>As a method return type 389</p> <p>As the base type of an array or collection 389</p> <p>As a more general type of object reference 390</p> <p>Using the C# Predefined Interface Types 390</p> <p>Looking at a Program That CAN_BE_USED_AS an Example 391</p> <p>Creating your own interface at home in your spare time 391</p> <p>Implementing the incomparable IComparable<T> interface 392</p> <p>Creating a list of students 394</p> <p>Testing everything using Main() 395</p> <p>Unifying Class Hierarchies 396</p> <p>Hiding Behind an Interface 399</p> <p>Inheriting an Interface 401</p> <p>Using Interfaces to Manage Change in Object-Oriented Programs 402</p> <p>Making flexible dependencies through interfaces 403</p> <p>Abstract or concrete: When to use an abstract class and when to use an interface 404</p> <p>Doing HAS_A with interfaces 405</p> <p><b>Chapter 8: Delegating Those Important Events</b><b> 407</b></p> <p>E.T., Phone Home — The Callback Problem 408</p> <p>Defining a Delegate 408</p> <p>Pass Me the Code, Please — Examples 411</p> <p>Delegating the task 411</p> <p>First, a simple example 412</p> <p>Considering the Action, Func, and Predicate delegate types 413</p> <p>A More Real-World Example 415</p> <p>Putting the app together 416</p> <p>Setting the properties and adding event handlers 418</p> <p>Looking at the workhorse code 419</p> <p>Shh! Keep It Quiet — Anonymous Methods 421</p> <p>Defining the basic anonymous method 421</p> <p>Using static anonymous methods 422</p> <p>Working with lambda discard parameters 424</p> <p>Stuff Happens — C# Events 424</p> <p>The Observer design pattern 425</p> <p>What’s an event? Publish/Subscribe 425</p> <p>How a publisher advertises its events 426</p> <p>How subscribers subscribe to an event 427</p> <p>How to publish an event 427</p> <p>How to pass extra information to an event handler 428</p> <p>A recommended way to raise your events 429</p> <p>How observers “handle” an event 430</p> <p><b>Chapter 9: Can I Use Your Namespace in the Library? </b><b>433</b></p> <p>Dividing a Single Program into Multiple Source Files 434</p> <p>Working with Global using Statements 435</p> <p>Dividing a Single Program into Multiple Assemblies 437</p> <p>Executable or library? 437</p> <p>Assemblies 437</p> <p>Executables 438</p> <p>Class libraries 439</p> <p>Putting Your Classes into Class Libraries 439</p> <p>Creating the projects for a class library 439</p> <p>Creating a stand-alone class library 440</p> <p>Adding a second project to an existing solution 442</p> <p>Creating the code for the library 445</p> <p>Using a test application to test a library 446</p> <p>Going Beyond Public and Private: More Access Keywords 448</p> <p>Internal: For CIA eyes only 448</p> <p>Protected: Sharing with subclasses 451</p> <p>Putting Classes into Namespaces 453</p> <p>Declaring a namespace 454</p> <p>Using file-scoped namespaces 456</p> <p>Relating namespaces to the access keyword story 456</p> <p>Using fully qualified names 458</p> <p>Working with partial classes 459</p> <p>Working with Partial Methods 463</p> <p>Defining what partial methods do 463</p> <p>Creating a partial method 464</p> <p><b>Chapter 10: Improving Productivity with Named and Optional Parameters</b><b> 465</b></p> <p>Exploring Optional Parameters 466</p> <p>Working with optional value parameters 466</p> <p>Avoiding optional reference types 468</p> <p>Looking at Named Parameters 470</p> <p>Using Alternative Methods to Return Values 470</p> <p>Output (out) parameters 471</p> <p>Working with out variables 471</p> <p>Returning values by reference 472</p> <p>Dealing with null Parameters 473</p> <p><b>Chapter 11: Interacting with Structures</b><b> 475</b></p> <p>Comparing Structures to Classes 476</p> <p>Considering struct limits 476</p> <p>Understanding the value type difference 477</p> <p>Determining when to use struct versus class 477</p> <p>Creating Structures 478</p> <p>Defining a basic struct 478</p> <p>Including common struct elements 479</p> <p>Using supplemental struct elements 482</p> <p>Working with Read-only Structures 485</p> <p>Working with Reference Structures 487</p> <p>Using Structures as Records 489</p> <p>Managing a single record 489</p> <p>Adding structures to arrays 489</p> <p>Overriding methods 490</p> <p>Using the New Record Type 491</p> <p>Comparing records to structures and classes 491</p> <p>Working with a record 492</p> <p>Using the positional syntax for property definition 493</p> <p>Understanding value equality 494</p> <p>Creating safe changes: Nondestructive mutation 494</p> <p>Using the field keyword 495</p> <p><b>Book 3: Designing For C#</b><b> 497</b></p> <p><b>Chapter 1: Writing Secure Code</b><b> 499</b></p> <p>Designing Secure Software 500</p> <p>Determining what to protect 500</p> <p>Documenting the components of the program 501</p> <p>Decomposing components into functions 502</p> <p>Identifying potential threats in functions 502</p> <p>Building Secure Windows Applications 503</p> <p>Authentication using Windows logon 503</p> <p>Encrypting information 507</p> <p>Deployment security 507</p> <p>Using System.Security 508</p> <p><b>Chapter 2: Accessing Data</b><b> 509</b></p> <p>Getting to Know System.Data 510</p> <p>How the Data Classes Fit into the Framework 512</p> <p>Getting to Your Data 512</p> <p>Using the System.Data Namespace 513</p> <p>Setting up a sample database schema 513</p> <p>Creating the data access project 514</p> <p>Connecting to a data source 514</p> <p>Working with the visual tools 519</p> <p>Writing data code 521</p> <p><b>Chapter 3: Fishing the File Stream</b><b> 525</b></p> <p>Going Where the Fish Are: The File Stream 525</p> <p>Streams 526</p> <p>Readers and writers 527</p> <p>StreamWriting for Old Walter 528</p> <p>Using the stream: An example 529</p> <p>Using some better fishing gear: The using statement 534</p> <p>Pulling Them Out of the Stream: Using StreamReader 537</p> <p>More Readers and Writers 539</p> <p>Exploring More Streams than Lewis and Clark 541</p> <p><b>Chapter 4: Accessing the Internet</b><b> 543</b></p> <p>Getting to Know System.Net 544</p> <p>How Net Classes Fit into the Framework 545</p> <p>Understanding the System.Net subordinate namespaces 545</p> <p>Working with the System.Net classes 548</p> <p>Using the System.Net Namespace 549</p> <p>Checking the network status 549</p> <p>Downloading a file from the Internet 551</p> <p>Emailing a status report 553</p> <p>Logging network activity 556</p> <p><b>Chapter 5: Creating Images</b><b> 559</b></p> <p>Getting to Know System.Drawing 560</p> <p>Graphics 561</p> <p>Pens 562</p> <p>Brushes 563</p> <p>Text 563</p> <p>How the Drawing Classes Fit into the Framework 564</p> <p>Using the System.Drawing Namespace 565</p> <p>Getting started 565</p> <p>Setting up the project 567</p> <p>Handling the score 567</p> <p>Creating an event connection 569</p> <p>Drawing the board 570</p> <p>Printing the score 572</p> <p>Starting a new game 574</p> <p><b>Chapter 6: Programming Dynamically!</b><b> 575</b></p> <p>Shifting C# Toward Dynamic Typing 576</p> <p>Employing Dynamic Programming Techniques 578</p> <p>Putting Dynamic to Use 580</p> <p>Classic examples 580</p> <p>Making static operations dynamic 581</p> <p>Understanding what’s happening under the covers 581</p> <p>Running with the Dynamic Language Runtime 582</p> <p>Using Static Anonymous Functions 585</p> <p><b>Book 4: A Tour of Visual Studio</b><b> 587</b></p> <p><b>Chapter 1: Getting Started with Visual Studio</b><b> 589</b></p> <p>Versioning the Versions 590</p> <p>An overview of Visual Studio 2022 updates 590</p> <p>Community edition 592</p> <p>Professional edition 594</p> <p>Enterprise edition 594</p> <p>MSDN 595</p> <p>Installing Visual Studio 596</p> <p>Breaking Down the Projects 597</p> <p>Exploring the Create a New Project dialog box 600</p> <p>Understanding solutions and projects 601</p> <p><b>Chapter 2: Using the Interface</b><b> 603</b></p> <p>Designing in the Designer 604</p> <p>Universal Windows Platform (UWP) application 604</p> <p>Windows Presentation Foundation (WPF) 607</p> <p>Windows Forms 609</p> <p>Data View 609</p> <p>Paneling the Studio 610</p> <p>Solution Explorer 610</p> <p>Properties 613</p> <p>The Toolbox 614</p> <p>Server Explorer 615</p> <p>Class View 617</p> <p>Coding in the Code Editor 618</p> <p>Exercising the Code Editor 618</p> <p>Exploring the auxiliary windows 619</p> <p>Using the Tools of the Trade 621</p> <p>The Tools menu 622</p> <p>Building 623</p> <p>Using the Debugger as an Aid to Learning 623</p> <p>Stepping through code 623</p> <p>Going to a particular code location 624</p> <p>Watching application data 625</p> <p>Viewing application internals 626</p> <p><b>Chapter 3: Customizing Visual Studio </b><b>627</b></p> <p>Setting Options 628</p> <p>Environment 629</p> <p>Language 630</p> <p>Neat stuff 631</p> <p>Creating Your Own Templates 632</p> <p>Developing a project template 632</p> <p>Developing an item template 635</p> <p><b>Book 5: Windows Development with Wpf</b><b> 639</b></p> <p><b>Chapter 1: Introducing WPF</b><b> 641</b></p> <p>Understanding What WPF Can Do 642</p> <p>Introducing XAML 643</p> <p>Diving In! Creating Your First WPF Application 644</p> <p>Declaring an application-scoped resource 647</p> <p>Making the application do something 648</p> <p>Whatever XAML Can Do, C# Can Do Better! 650</p> <p><b>Chapter 2: Understanding the Basics of WPF </b><b>653</b></p> <p>Using WPF to Lay Out Your Application 654</p> <p>Arranging Elements with Layout Panels 655</p> <p>The Stack panel 656</p> <p>The Wrap panel 660</p> <p>The Dock panel 661</p> <p>Canvas 662</p> <p>The Grid 662</p> <p>Putting it all together with a simple data entry form 669</p> <p>Exploring Common XAML Controls 672</p> <p>Display-only controls 672</p> <p>Basic input controls 674</p> <p>List-based controls 677</p> <p><b>Chapter 3: Data Binding in WPF</b><b> 681</b></p> <p>Getting to Know Dependency Properties 682</p> <p>Exploring the Binding Modes 683</p> <p>Investigating the Binding Object 683</p> <p>Defining a binding with XAML 684</p> <p>Defining a binding with C# 686</p> <p>Editing, Validating, Converting, and Visualizing Your Data 687</p> <p>Validating data 693</p> <p>Converting your data 697</p> <p>Finding Out More about WPF Data Binding 705</p> <p><b>Chapter 4: Practical WPF</b><b> 707</b></p> <p>Commanding Attention 708</p> <p>Traditional event handling 708</p> <p>ICommand 709</p> <p>Routed commands 710</p> <p>Using Built-In Commands 711</p> <p>Using Custom Commands 713</p> <p>Defining the interface 713</p> <p>Creating the window binding 714</p> <p>Ensuring that the command can execute 714</p> <p>Performing the task 715</p> <p>Using Routed Commands 717</p> <p>Defining the Command class 717</p> <p>Making the namespace accessible 718</p> <p>Adding the command bindings 718</p> <p>Developing a user interface 718</p> <p>Developing the custom command code-behind 719</p> <p><b>Chapter 5: Programming for Windows 10 and Above</b><b> 721</b></p> <p>What is the Universal Windows Platform (UWP)? 722</p> <p>Devices Supported by the UWP 725</p> <p>Creating Your Own UWP App 726</p> <p>Configuring Developer Mode 726</p> <p>Defining the project 732</p> <p>Creating an interface 734</p> <p>Adding some background code 738</p> <p>Choosing a test device 739</p> <p>Working with NET Core Applications 740</p> <p><b>Book 6: Web Development with Asp.Net</b><b> 743</b></p> <p><b>Chapter 1: Creating a Basic ASP.NET Core App</b><b> 745</b></p> <p>Understanding the ASP.NET Core Templates 746</p> <p>Starting with nothing using ASP.NET Core Empty 746</p> <p>Creating a basic app using the ASP.NET Core Web App 748</p> <p>Fumbling around with HTTPS-enabled sites 749</p> <p>Building in business logic using ASP.NET Core App</p> <p>(Model-View-Controller) 751</p> <p>Developing a programming interface using ASP.NET</p> <p>Core Web API 752</p> <p>An overview of those other weird templates 753</p> <p>Developing a Basic Web App 754</p> <p>Creating the project 754</p> <p>Considering the development process 756</p> <p>Adding web content 757</p> <p>Making some basic changes to the first page 759</p> <p><b>Chapter 2: Employing the Razor Markup Language</b><b> 761</b></p> <p>Avoiding Nicks from Razor 762</p> <p>Comparing Razor to its predecessors 762</p> <p>Considering the actual file layout 763</p> <p>Understanding the syntax rules for C# 766</p> <p>Working with some Razor basics 767</p> <p>Creating Variables 770</p> <p>Keeping Things Logical 771</p> <p>Starting simply by using if 771</p> <p>Sleeping at the switch 771</p> <p>Implementing Loops 772</p> <p>Creating an array 772</p> <p>Performing tasks a specific number of times using for 773</p> <p>Processing an unknown number of times using for each and while 773</p> <p><b>Chapter 3: Generating and Consuming Data</b><b> 775</b></p> <p>Understanding Why These Projects Are Important 776</p> <p>Serialized Data Isn’t for Breakfast 777</p> <p>Developing a Data Generator and API 778</p> <p>Creating the WeatherForecast project 778</p> <p>Making the data believable 781</p> <p>Looking at the API configuration 783</p> <p>Checking the API for functionality 784</p> <p>Creating a Consumer Website 786</p> <p>Creating the RetrieveWeatherForecast project 786</p> <p>Developing a user interface 787</p> <p>Getting and deserializing the data 789</p> <p>Seeing the application in action 793</p> <p>Index 795</p>
<p><b> John Paul Mueller</b> is an author and technical editor with experience in application development, database management, machine learning, and deep learning. He has written hundreds of books and articles helping everyday people learn everything from networking to database management.</p>
<p><b>Hone your skills and get the latest on C#</b></p> <p>Ready to become a C# super-coder? <i>C# 10.0 All-in-One For Dummies</i> is your manual for getting started and keeping up with this popular programming language. With 6 minibooks inside, you can walk through writing your first console application in C#, learn how to code for Windows and for the web, master Visual Studio, bring object-oriented programming into focus, use the new Universal Windows<sup>®</sup> Platform (UWP), and design incredible software with the sharpest language on the block. This version is full of examples and code snippets—more than ever before—so you can see C# in action. <p><b> Six Books Inside… <ul><li>The Basics of C# Programming</li> <li>Object-Oriented C# Programming</li> <li>Designing for C#</li> <li>A Tour of Visual Studio<sup>®</sup></li> <li>Windows Development with WPF</li> <li>Web Development with ASP.NET Core</b></li></ul>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €