ebook img

Beginning C# 7 Hands-On The Core Language PDF

476 Pages·017.566 MB·
by  Unknown
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Beginning C# 7 Hands-On The Core Language

Contents 1: Why C# and How to Download and Install the Visual Studio Community Edition b'Chapter 1: Why C# and How to Download and Install the Visual Studio Community Edition' b'Locating and downloading the Visual Studio Community edition' b'Summary' 2: Customizing Visual Studio to Make it Feel More Personal b'Chapter 2: Customizing Visual Studio to Make it Feel More Personal' b'Customizing Visual Studio' b'Selecting the text editor font and size' b'Selecting the Statement Completion font and size' b'Selecting the Environment font and size' b'Positioning Visual Studio panels' b'Summary' 3: Creating and Running Your First Page b'Chapter 3: Creating and Running Your First Page' b'Starting a new project in Visual C#' b'Working with Solutions Explorer' b'Adding a document to your browser' b'Working with HTML code in Visual Studio' b'Launching the HTML code' b'Summary' 4: Creating and Running a Page That Incorporates C# b'Chapter 4: Creating and Running a Page That Incorporates C#' b'Improving your first program' b'Working in the Design view' b'Working in the Source view' b'Viewing the code in your browser' b'Summary' 5: Creating and Using a Single Variable b'Chapter 5: Creating and Using a Single Variable' b'Setting up Visual C# to deal with a variable' b'Running the code' b'Summary' 6: String Interpolation and Updating Visual Studio b'Chapter 6: String Interpolation and Updating Visual Studio' b'Selecting a NuGet package' b'Summary' 7: Formatting Output Strings for More Professional Results b'Chapter 7: Formatting Output Strings for More Professional Results' b'Setting a value and formatting it as currency' b'Summary' 8: Using Variables and Data Types b'Chapter 8: Using Variables and Data Types' b'Setting a page title automatically' b'Summary' 9: Computed Variables and Basic Math b'Chapter 9: Computed Variables and Basic Math' b'Declaring and setting two variables to signify two different salaries' b'Summary' 10: Interacting with Users Through the Web Page b'Chapter 10: Interacting with Users Through the Web Page' b'Using Toolbox to search for a command' b'Summary' 11: Using Method Chaining to Write More Compact Code b'Chapter 11: Using Method Chaining to Write More Compact Code' b'Inserting a text box into the markup' b'Summary' 12: Reacting to a Single Condition with If/Else Blocks b'Chapter 12: Reacting to a Single Condition with If/Else Blocks' b'Adding checkbox to your code' 13: Making a Variable Grow by Adding 1 b'Chapter 13: Making a Variable Grow by Adding 1' b'Growing a variable by one' b'Summary' 14: Repeating Blocks of Code with While Loops b'Chapter 14: Repeating Blocks of Code with While Loops' b'Inserting a button' b'Summary' 15: Repeating Blocks of Code with For Loops b'Chapter 15: Repeating Blocks of Code with For Loops' b'Inserting a button' b'Summary' 16: Iterating Over Collections with foreach Loops b'Chapter 16: Iterating Over Collections with foreach Loops' b'Inserting TextBox' b'Summary' 17: Examining Multiple Variable Values with Switch Blocks b'Chapter 17: Examining Multiple Variable Values with Switch Blocks' b'Inserting DropBox and Label' b'Summary' 18: Improving Input Processing with TryParse b'Chapter 18: Improving Input Processing with TryParse' b'Inserting a button and a textbox' b'Summary' 19: Replacing If/Else Blocks with the Ternary Operator b'Chapter 19: Replacing If/Else Blocks with the Ternary Operator' b'Inserting two text boxes and a button' b'Summary' 20: Operators That Evaluate and Assign in Place b'Chapter 20: Operators That Evaluate and Assign in Place' b'Inserting Button and Label' b'Summary' 21: Checking Two Conditions with the Logical AND Operator b'Chapter 21: Checking Two Conditions with the Logical AND Operator' b'Setting up the project' b'Summary' 22: Checking Two Conditions with the Logical OR Operator b'Chapter 22: Checking Two Conditions with the Logical OR Operator' b'Working with check boxes' b'Summary' 23: Declaring, Setting, and Reading Arrays b'Chapter 23: Declaring, Setting, and Reading Arrays' b'Setting up the basic interface' b'Summary' 24: Iterating Over Arrays with foreach and for Loops b'Chapter 24: Iterating Over Arrays with foreach and for Loops' b'Setting up the beginning interface' b'Summary' 25: Creating and Using a Simple Method b'Chapter 25: Creating and Using a Simple Method' b'Setting up the user interface' b'Summary' 26: Passing Arrays into Methods b'Chapter 26: Passing Arrays into Methods' b'Setting up the user interface' b'Summary' 27: Reference Type and Value Type Variables b'Chapter 27: Reference Type and Value Type Variables' b'Setting up the user interface' b'Summary' 28: Creating More Flexible Methods with the params Keyword b'Chapter 28: Creating More Flexible Methods with the params Keyword' b'Designing the starting markup' b'Summary' 29: Creating More Flexible Functions with the out Keyword b'Chapter 29: Creating More Flexible Functions with the out Keyword' b'Setting up the beginning interface' b'Summary' 30: Combining the ref and out Keywords to Write Flexible Functions b'Chapter 30: Combining the ref and out Keywords to Write Flexible Functions' b'Setting up the starting interface' b'Summary' 31: The out keyword in C# 7 b'Chapter 31: The out keyword in C# 7' b'Creating the program template' b'Writing the Summarize function' b'Implementing the function' b'Running the program' 32: Multidimensional Arrays b'Chapter 32: Multidimensional Arrays' b'Understanding two-dimensional arrays' b'Summary' 33: Writing Easier Code with the Var and Dynamic Keywords b'Chapter 33: Writing Easier Code with the Var and Dynamic Keywords' b'Setting up the project' b'Summary' 34: Creating a Class with a Constructor and a Function b'Chapter 34: Creating a Class with a Constructor and a Function' b'Our initial markup' b'Summary' 35: Creating a Class with a Static Method b'Chapter 35: Creating a Class with a Static Method' b'Setting up a simple initial interface' b'Summary' 36: Creating a Class with an Object Property b'Chapter 36: Creating a Class with an Object Property' b'Setting up a simple markup page' b'Summary' 37: Creating a Class with Static Fields, Functions, and Properties b'Chapter 37: Creating a Class with Static Fields, Functions, and Properties' b'Setting up the interface for this project' b'Summary' 38: Centralizing Common Code with Inheritance b'Chapter 38: Centralizing Common Code with Inheritance' b'Setting up the interface for this lesson' b'Summary' 39: Centralizing Default Code with Virtual Functions b'Chapter 39: Centralizing Default Code with Virtual Functions' b'Setting up a basic HTML for this project' b'Summary' 40: Model Concepts with Abstract Classes b'Chapter 40: Model Concepts with Abstract Classes' b'Introducing the basic HTML for this lesson's project' b'Summary' 41: Using Custom Types as Return Types b'Chapter 41: Using Custom Types as Return Types' b'Setting up the project' b'Summary' 42: Using Lists to Operate on Data Efficiently b'Chapter 42: Using Lists to Operate on Data Efficiently' b'Summarizing the values in a list' b'Summary' 43: Writing Less Code with Polymorphism b'Chapter 43: Writing Less Code with Polymorphism' b'Setting up the markup for this project' b'Summary' 44: Using Interfaces to Express Common Behaviors b'Chapter 44: Using Interfaces to Express Common Behaviors' b'Building a hierarchy' b'Summary' 45: Iterating over Instances with Indexers b'Chapter 45: Iterating over Instances with Indexers' b'Setting up a records project' b'Summary' 46: Building Stabler Apps with Exception Handling b'Chapter 46: Building Stabler Apps with Exception Handling' b'Setting up the HTML for this chapter' b'Using a try block' b'Summary' 47: Using Named and Optional Parameters b'Chapter 47: Using Named and Optional Parameters' b'Setting up the Book class' b'Summary' 48: Using the Null Coalescing Operator to Write Stabler Applications b'Chapter 48: Using the Null Coalescing Operator to Write Stabler Applications' b'Setting up the basic HTML for this project' b'Searching a database' b'Summary' 49: Overloading Operators to Perform Custom Operations b'Chapter 49: Overloading Operators to Perform Custom Operations' b'Creating a Vector class' b'Summary' 50: Using Enumerations to Represent Named Constants b'Chapter 50: Using Enumerations to Represent Named Constants' b'Setting up a drop-down list' b'Summary' 51: Creating and Using Namespaces b'Chapter 51: Creating and Using Namespaces' b'Creating a new project with a new namespace' b'Summary' 52: Structs, Random Points, and Sleeping Threads b'Chapter 52: Structs, Random Points, and Sleeping Threads' b'Adding a SimpleStruct class file' b'Coding the struct' b'Modifying the HTML to make use of the struct' b'Making an array of points' b'Displaying the results' b'Running the program' b'Debugging the program' b'Lesson review' b'Summary' 53: Declaring, Creating, and Using Delegates b'Chapter 53: Declaring, Creating, and Using Delegates' b'Setting up the HTML for this project' b'Checking out the interface' b'Making a delegate' b'Running the program' b'Summary' 54: Switch Blocks with when b'Chapter 54: Switch Blocks with when' b'Creating the classes' b'Writing the Main function code' b'Running the program' 55: Switch Blocks with Objects in C# 7.0 b'Chapter 55: Switch Blocks with Objects in C# 7.0' b'Creating the interface' b'Implementing the interface' b'Creating the Main() program' b'Running the program' 56: Tuples b'Chapter 56: Tuples' b'Creating the tuple function' b'Writing the Main() code' b'Running the program' 57: Local functions in C# 7.0 b'Chapter 57: Local functions in C# 7.0' b'Creating the application and core functions' b'Creating the local function' b'Running the code' 58: Throwing Exceptions b'Chapter 58: Throwing Exceptions' b'Creating the main code' b'Running the program' Chapter 1. Why C# and How to Download and Install the Visual Studio Community Edition If you visit a page like indeed.com and enter C# in the what box, you'll get results that show that there are many jobs in this field, as shown in Figure 1.1.1. This shows that C# is a very valuable skill to master. Perhaps you just like to tinker, and C# is great for that as well: Figure 1.1.1: The many job listings for C# programmers [1] Locating and downloading the Visual Studio Community edition In this chapter, we're going to take a look at how to get Visual Studio 2017. You can either go directly to www.visualstudio.com/downloads or just do a search for Visual Studio 2017 download. This should bring you to a page similar to this one: Figure 2.1: Installing Visual Studio 2017 Keep in mind that these pages are updated regularly. In the preceding screenshot, you will see that there are several versions. The one that interests us, of course, is Visual Studio Community 2017, the free version. Click on Free download. This should automatically download a small installer. Depending on how your system is set up, it will either download it directly to the Downloads folder, or prompt you for where you want to save it. I've created a VS_Community folder inside my Downloads folder and saved it there. Of course, you can save it wherever you want to. Once this is done--it won't take long as it's just a small file--locate the downloaded VS_Community EXE file and open it up. Once you open it, you should see this screen: [2]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.