logo资料库

C# Programming Cookbook 无水印pdf 0分.pdf

第1页 / 共620页
第2页 / 共620页
第3页 / 共620页
第4页 / 共620页
第5页 / 共620页
第6页 / 共620页
第7页 / 共620页
第8页 / 共620页
资料共620页,剩余部分请下载后查看
Cover
Table of Contents
Copyright
About the Author
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. New Features in C# 6.0
Introduction
Creating your Visual Studio project
Getting ready
How to do it…
How it works…
String interpolation
Getting ready
How to do it…
How it works…
Null-conditional operator
Getting ready
How to do it…
How it works…
Initializers for auto-implemented properties and getter-only auto properties
Getting ready
How to do it…
How it works…
Index initializers
Getting ready
How to do it…
How it works…
The nameof expressions
Getting ready
How to do it…
How it works…
Expression-bodied functions and properties
Getting ready
How to do it…
How it works…
Using static
Getting ready
How to do it…
How it works…
Exception filters
Getting ready
How to do it…
How it works…
Using await operator in catch and finally blocks
Getting ready
How to do it…
How it works…
2. Classes and Generics
Introduction
Creating and implementing an abstract class
Getting ready
How to do it…
How it works…
Creating and implementing an interface
Getting ready
How to do it…
How it works…
Creating and using a generic class or method
Getting ready
How to do it…
How it works…
Creating and using a generic interface
Getting ready
How to do it…
How it works…
3. Object-Oriented Programming in C#
Introduction
Using inheritance in C#
Getting ready
How to do it…
How it works…
Using abstraction
Getting ready
How to do it…
How it works…
Leveraging encapsulation
Getting ready
How to do it…
How it works…
Implementing polymorphism
Getting ready
How to do it…
How it works…
Single responsibility principle
Getting ready
How to do it…
How it works…
Open/closed principle
Getting ready
How to do it…
How it works…
4. Composing Event-Based Programs Using Reactive Extensions
Introduction
Installing Rx
Getting ready
How to do it…
How it works…
Events versus observables
Getting ready
How to do it…
How it works…
Using LINQ to perform queries
Getting ready
How to do it…
How it works…
Using schedulers in Rx
Getting ready
How to do it…
How it works…
Debugging lambda expressions
Getting ready
How to do it…
How it works…
5. Create Microservices on Azure Service Fabric
Introduction
Downloading and installing Service Fabric
Getting ready
How to do it…
How it works…
Creating a Service Fabric application with a stateless actor service
Getting ready
How to do it…
How it works…
Using Service Fabric Explorer
Getting ready
How to do it…
How it works…
6. Making Apps Responsive with Asynchronous Programming
Introduction
Return types of asynchronous functions
Getting ready
How to do it…
How it works…
Handling tasks in asynchronous programming
Getting ready
How to do it…
How it works…
Exception handling in asynchronous programming
Getting ready
How to do it…
How it works…
7. High Performance Programming Using Parallel and Multithreading in C#
Introduction
Creating and aborting a low-priority background thread
Getting ready
How to do it…
How it works…
Increasing maximum thread pool size
Getting ready
How to do it…
How it works…
Creating multiple threads
Getting ready
How to do it…
How it works…
Locking one thread until the contended resources are available
Getting ready
How to do it…
How it works…
Invoking parallel calls to methods using Parallel.Invoke
Getting ready
How to do it…
How it works…
Using a parallel foreach loop to run multiple threads
Getting ready
How to do it…
How it works…
Cancelling a parallel foreach loop
Getting ready
How to do it…
How it works…
Catching errors in parallel foreach loops
Getting ready
How to do it…
How it works…
Debugging multiple threads
Getting ready
How to do it…
How it works…
8. Code Contracts
Introduction
Downloading, installing, and integrating code contracts into Visual Studio
Getting ready
How to do it…
How it works…
Creating code contract preconditions
Getting ready
How to do it…
How it works…
Creating code contract postconditions
Getting ready
How to do it…
How it works…
Creating code contract invariant
Getting ready
How to do it…
How it works…
Creating code contract Assert and Assume methods
Getting ready
How to do it…
How it works…
Creating code contract ForAll method
Getting ready
How to do it…
How it works…
Creating code contract ValueAtReturn method
Getting ready
How to do it…
How it works…
Creating code contract Result method
How to do it…
How it works…
Using code contracts on abstract classes
Getting ready
How to do it…
How it works…
Using contract abbreviator methods
Getting ready
How to do it…
How it works…
Creating tests using IntelliTest
Getting ready
How to do it…
How it works…
Using code contracts in extension methods
Getting ready
How to do it…
How it works…
9. Regular Expressions
Introduction
Getting started with regex
Getting ready
How to do it…
How it works…
Matching a valid date
Getting ready
How to do it…
How it works…
Sanitizing input
Getting ready
How to do it…
How it works…
Dynamic regex matching
Getting ready
How to do it…
How it works…
10. Choosing and Using a Source Control Strategy
Introduction
Setting up Visual Studio account management and determining which source control solution is best for you
Getting ready
How to do it...
How it works...
Setting up Visual Studio GitHub integration, checking in code for the first time, and checking in changes
Getting ready
How to do it...
How it works...
Working as a team using GitHub, and handling and resolving conflicts in code
Getting ready
How to do it...
How it works...
11. Creating a Mobile Application in Visual Studio
Introduction
Installing Xamarin and other required components
Getting ready
How to do it…
How it works…
Creating an Android Visual Studio project using Apache Cordova
Getting ready
How to do it…
How it works…
Creating an iOS application using Xamarin Forms
Getting ready
How to do it…
How it works…
12. Writing Secure Code and Debugging in Visual Studio
Introduction
Encrypting and storing passwords correctly
Getting ready
How to do it…
How it works…
Using SecureString in code
Getting ready
How to do it…
How it works…
Securing sensitive parts of App.config/web.config
Getting ready
How to do it…
How it works…
Preventing SQL injection attacks
Getting ready
How to do it…
How it works…
Using Diagnostic Tools and Historical Debugging
Getting ready
How to do it…
How it works…
Setting conditional breakpoints
Getting ready
How to do it…
How it works…
Using PerfTips to identify bottlenecks in code
Getting ready
How to do it…
How it works…
13. Creating a Web Application in Azure
Introduction
Creating a database in Azure for testing
Getting ready
How to do it…
How it works…
Creating a web application and hosting on Azure
Getting ready
How to do it…
How it works…
Using virtual machines on Azure
Getting ready
How to do it…
How it works…
Index
Table of Contents C# Programming Cookbook Credits About the Author Acknowledgements About the Reviewer www.PacktPub.com eBooks, discount offers, and more Why Subscribe? Preface What this book covers What you need for this book Who this book is for Sections Getting ready How to do it… How it works… There's more… See also Conventions Reader feedback Customer support Downloading the example code Downloading the color images of this book Errata Piracy Questions 1. New Features in C# 6.0 Introduction Creating your Visual Studio project Getting ready How to do it… How it works… String interpolation Getting ready How to do it… How it works… Null-conditional operator Getting ready How to do it…
Initializers for auto-implemented properties and getter-only auto properties Using await operator in catch and finally blocks 2. Classes and Generics Introduction Creating and implementing an abstract class Creating and implementing an interface Creating and using a generic class or method Expression-bodied functions and properties The nameof expressions How it works… Getting ready How to do it… How it works… Index initializers Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Using static Getting ready How to do it… How it works… Exception filters Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works…
Creating and using a generic interface Getting ready How to do it… How it works… 3. Object-Oriented Programming in C# Introduction Using inheritance in C# Getting ready How to do it… How it works… Using abstraction Getting ready How to do it… How it works… Leveraging encapsulation 4. Composing Event-Based Programs Using Reactive Extensions Implementing polymorphism Single responsibility principle Open/closed principle Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Introduction Installing Rx Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… Events versus observables Using LINQ to perform queries
How it works… Using schedulers in Rx Debugging lambda expressions 5. Create Microservices on Azure Service Fabric Introduction Downloading and installing Service Fabric Creating a Service Fabric application with a stateless actor service Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Using Service Fabric Explorer 6. Making Apps Responsive with Asynchronous Programming Introduction Return types of asynchronous functions Handling tasks in asynchronous programming Exception handling in asynchronous programming 7. High Performance Programming Using Parallel and Multithreading in C# Introduction Creating and aborting a low-priority background thread
Increasing maximum thread pool size Creating multiple threads Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Locking one thread until the contended resources are available Invoking parallel calls to methods using Parallel.Invoke Using a parallel foreach loop to run multiple threads Cancelling a parallel foreach loop Catching errors in parallel foreach loops Debugging multiple threads Getting ready How to do it… How it works… Getting ready How to do it… How it works… 8. Code Contracts Getting ready How to do it… How it works… Getting ready How to do it… How it works… Creating code contract preconditions Creating code contract postconditions Introduction Downloading, installing, and integrating code contracts into Visual Studio
Creating code contract invariant Creating code contract Assert and Assume methods Creating code contract ForAll method Creating code contract ValueAtReturn method Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… Creating code contract Result method Using code contracts on abstract classes Using contract abbreviator methods Creating tests using IntelliTest Using code contracts in extension methods 9. Regular Expressions Introduction Getting started with regex Getting ready How to do it…
How it works… Matching a valid date Getting ready How to do it… How it works… Sanitizing input Getting ready How to do it… How it works… Dynamic regex matching Getting ready How to do it… How it works… Getting ready How to do it... How it works... Getting ready How to do it... How it works... Getting ready How to do it... How it works... Getting ready How to do it… How it works… Getting ready How to do it… How it works… Getting ready How to do it… How it works… 10. Choosing and Using a Source Control Strategy Introduction Setting up Visual Studio account management and determining which source control solution is best for you Setting up Visual Studio GitHub integration, checking in code for the first time, and checking in changes Working as a team using GitHub, and handling and resolving conflicts in code 11. Creating a Mobile Application in Visual Studio Introduction Installing Xamarin and other required components Creating an Android Visual Studio project using Apache Cordova Creating an iOS application using Xamarin Forms
分享到:
收藏