1. Trang chủ
  2. » Kinh Doanh - Tiếp Thị

Beginning c sharp 6 0 programming with visual studio 2015

1.2K 38 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Title Page

  • Introduction

    • Who This Book Is For

    • What This Book Covers

    • How This Book Is Structured

    • What You Need to Use This Book

    • Conventions

    • Source Code

    • Errata

    • p2p.wrox.com

  • Part I: The OOP Language

    • Chapter 1: Introducing C#

      • What Is the .NET Framework?

      • What Is C#?

      • Visual Studio 2015

    • Chapter 2: Writing a C# Program

      • The Visual Studio 2015 Development Environment

      • Console Applications

      • Desktop Applications

    • Chapter 3: Variables and Expressions

      • Basic C# Syntax

      • Basic C# Console Application Structure

      • Variables

      • Expressions

    • Chapter 4: Flow Control

      • Boolean Logic

      • Branching

      • Looping

    • Chapter 5: More about Variables

      • Type Conversion

      • Complex Variable Types

      • String Manipulation

    • Chapter 6: Functions

      • Defining and Using Functions

      • Variable Scope

      • The Main() Function

      • Struct Functions

      • Overloading Functions

      • Using Delegates

    • Chapter 7: Debugging and Error Handling

      • Debugging in Visual Studio

      • Error Handling

    • Chapter 8: Introduction to Object-Oriented Programming

      • What Is Object-Oriented Programming?

      • OOP Techniques

      • OOP in Desktop Applications

    • Chapter 9: Defining Classes

      • Class Definitions in C#

      • System.Object

      • Constructors and Destructors

      • OOP Tools in Visual Studio

      • Class Library Projects

      • Interfaces Versus Abstract Classes

      • Struct Types

      • Shallow Copying Versus Deep Copying

    • Chapter 10: Defining Class Members

      • Member Definitions

      • Additional Class Member Topics

      • Interface Implementation

      • Partial Class Definitions

      • Partial Method Definitions

      • Example Application

      • The Call Hierarchy Window

    • Chapter 11: Collections, Comparisons, and Conversions

      • Collections

      • Comparisons

      • Conversions

    • Chapter 12: Generics

      • What Are Generics?

      • Using Generics

      • Defining Generic Types

      • Variance

    • Chapter 13: Additional C# Techniques

      • The : : Operator and the Global Namespace Qualifier

      • Custom Exceptions

      • Events

      • Expanding and Using CardLib

      • Attributes

      • Initializers

      • Type Inference

      • Anonymous Types

      • Dynamic Lookup

      • Advanced Method Parameters

      • Lambda Expressions

  • Part II: Windows Programming

    • Chapter 14: Basic Desktop Programming

      • XAML

      • The Playground

      • Control Layout

      • The Game Client

    • Chapter 15: Advanced Desktop Programming

      • Creating and Styling Controls

      • WPF User Controls

      • Putting It All Together

  • Part III: Cloud Programming

    • Chapter 16: Basic Cloud Programming

      • The Cloud, Cloud Computing, and the Cloud Optimized Stack

      • Cloud Patterns and Best Practices

      • Using Microsoft Azure C# Libraries to Create a Storage Container

      • Creating an ASP.NET 4.6 Web Site that Uses the Storage Container

      • How It Works

    • Chapter 17: Advanced Cloud Programing and Deployment

      • Creating an ASP.NET Web API

      • Deploying and Consuming an ASP.NET Web API on Microsoft Azure

      • Scaling an ASP.NET Web API on Microsoft Azure

  • Part IV: Data Access

    • Chapter 18: Files

      • File Classes for Input and Output

      • Streams

      • Monitoring the File System

    • Chapter 19: XML and JSON

      • JSON Basics

      • XML Schemas

      • Converting XML to JSON

    • Chapter 20: LINQ

      • LINQ to XML

      • LINQ Query Syntax

      • LINQ Method Syntax

      • Ordering Query Results

      • Understanding the orderby Clause

      • Querying a Large Data Set

      • Using Aggregate Operators

      • Using the Select Distinct Query

      • Ordering by Multiple Levels

      • Using Group Queries

      • Using Joins

    • Chapter 21: Databases

      • Using Databases

      • Installing SQL Server Express

      • Entity Framework

      • A Code First Database

      • But Where Is My Database?

      • Navigating Database Relationships

      • Handling Migrations

      • Creating and Querying XML from an Existing Database

  • Part V: Additional Techniques

    • Chapter 22: Windows Communication Foundation

      • What Is WCF?

      • WCF Concepts

      • WCF Programming

    • Chapter 23: Universal Apps

      • Getting Started

      • Universal Apps

      • App Concepts and Design

      • App Development

      • Common Elements of Windows Store Apps

      • The Windows Store

    • Appendix: Exercise Solutions

      • Chapter 4 Solutions

      • Chapter 5 Solutions

      • Chapter 6 Solutions

      • Chapter 7 Solutions

      • Chapter 8 Solutions

      • Chapter 9 Solutions

      • Chapter 10 Solutions

      • Chapter 11 Solutions

      • Chapter 12 Solutions

      • Chapter 13 Solutions

      • Chapter 14 Solutions

      • Chapter 15 Solutions

      • Chapter 16 Solutions

      • Chapter 17 Solutions

      • Chapter 18 Solutions

      • Chapter 19 Solutions

      • Chapter 20 Solutions

      • Chapter 21 Solutions

      • Chapter 22 Solutions

      • Chapter 23 Solutions

  • End User License Agreement

Nội dung

Table of Contents Title Page Introduction Who This Book Is For What This Book Covers How This Book Is Structured What You Need to Use This Book Conventions Source Code Errata p2p.wrox.com Part I: The OOP Language Chapter 1: Introducing C# What Is the NET Framework? What Is C#? Visual Studio 2015 Chapter 2: Writing a C# Program The Visual Studio 2015 Development Environment Console Applications Desktop Applications Chapter 3: Variables and Expressions Basic C# Syntax Basic C# Console Application Structure Variables Expressions Chapter 4: Flow Control Boolean Logic Branching Looping Chapter 5: More about Variables Type Conversion Complex Variable Types String Manipulation Chapter 6: Functions Defining and Using Functions Variable Scope The Main() Function Struct Functions Overloading Functions Using Delegates Chapter 7: Debugging and Error Handling Debugging in Visual Studio Error Handling Chapter 8: Introduction to Object-Oriented Programming What Is Object-Oriented Programming? OOP Techniques OOP in Desktop Applications Chapter 9: Defining Classes Class Definitions in C# System.Object Constructors and Destructors OOP Tools in Visual Studio Class Library Projects Interfaces Versus Abstract Classes Struct Types Shallow Copying Versus Deep Copying Chapter 10: Defining Class Members Member Definitions Additional Class Member Topics Interface Implementation Partial Class Definitions Partial Method Definitions Example Application The Call Hierarchy Window Chapter 11: Collections, Comparisons, and Conversions Collections Comparisons Conversions Chapter 12: Generics What Are Generics? Using Generics Defining Generic Types Variance Chapter 13: Additional C# Techniques The : : Operator and the Global Namespace Qualifier Custom Exceptions Events Expanding and Using CardLib Attributes Initializers Type Inference Anonymous Types Dynamic Lookup Advanced Method Parameters Lambda Expressions Part II: Windows Programming Chapter 14: Basic Desktop Programming XAML The Playground Control Layout The Game Client Chapter 15: Advanced Desktop Programming Creating and Styling Controls WPF User Controls Putting It All Together Part III: Cloud Programming Chapter 16: Basic Cloud Programming The Cloud, Cloud Computing, and the Cloud Optimized Stack Cloud Patterns and Best Practices Using Microsoft Azure C# Libraries to Create a Storage Container Creating an ASP.NET 4.6 Web Site that Uses the Storage Container How It Works Chapter 17: Advanced Cloud Programing and Deployment Creating an ASP.NET Web API Deploying and Consuming an ASP.NET Web API on Microsoft Azure Scaling an ASP.NET Web API on Microsoft Azure Part IV: Data Access Chapter 18: Files File Classes for Input and Output Streams Monitoring the File System Chapter 19: XML and JSON JSON Basics XML Schemas Converting XML to JSON Chapter 20: LINQ LINQ to XML LINQ Query Syntax LINQ Method Syntax Ordering Query Results Understanding the orderby Clause Querying a Large Data Set Using Aggregate Operators Using the Select Distinct Query Ordering by Multiple Levels Using Group Queries Using Joins Chapter 21: Databases Using Databases Installing SQL Server Express Entity Framework A Code First Database But Where Is My Database? Navigating Database Relationships Handling Migrations Creating and Querying XML from an Existing Database Part V: Additional Techniques Chapter 22: Windows Communication Foundation What Is WCF? WCF Concepts WCF Programming Chapter 23: Universal Apps Getting Started Universal Apps App Concepts and Design App Development Common Elements of Windows Store Apps The Windows Store Appendix: Exercise Solutions Chapter 4 Solutions Chapter 5 Solutions Chapter 6 Solutions Chapter 7 Solutions Chapter 8 Solutions Chapter 9 Solutions Chapter 10 Solutions Chapter 11 Solutions Chapter 12 Solutions Chapter 13 Solutions Chapter 14 Solutions Chapter 15 Solutions Chapter 16 Solutions Chapter 17 Solutions Chapter 18 Solutions Chapter 19 Solutions Chapter 20 Solutions Chapter 21 Solutions Chapter 22 Solutions Chapter 23 Solutions End User License Agreement List of Illustrations Chapter 1: Introducing C# Figure 1.1 Figure 1.2 Figure 1.3 Figure 1.4 Chapter 2: Writing a C# Program Figure 2.1 Figure 2.2 Figure 2.3 Figure 2.3 Figure 2.4 Figure 2.5 Figure 2.6 Figure 2.7 Figure 2.8 Figure 2.9 Figure 2.10 Figure 2.11 Figure 2.12 Figure 2.13 Chapter 3: Variables and Expressions Figure 3.1 Figure 3.2 Figure 3.3 Figure 3.4 Chapter 4: Flow Control Figure 4.1 Figure 4.2 Figure 4.3 Figure 4.4 Figure 4.5 Figure 4.6 Figure 4.7 Chapter 5: More about Variables Figure 5.1 Figure 5.2 Figure 5.3 Figure 5.4 Figure 5.5 Figure 5.6 Figure 5.7 Figure 5.8 Figure 5.9 Figure 5.10 Figure 5.11 Figure 5.12 Figure 5.13 Figure 5.14 Chapter 6: Functions Figure 6.1 Figure 6.2 Figure 6.3 Figure 6.4 Figure 6.5 Figure 6.6 Figure 6.7 Figure 6.8 Figure 6.9 Figure 6.10 Chapter 7: Debugging and Error Handling Figure 7.1 Figure 7.2 Figure 7.3 Figure 7.4 Figure 7.5 Figure 7.6 Figure 7.7 Figure 7.8 Figure 7.9 Figure 7.10 Figure 7.11 Figure 7.12 Figure 7.13 Figure 7.14 Figure 7.15 Figure 7.16 Figure 7.17 Figure 7.18 Figure 7.19 Figure 7.20 Chapter 8: Introduction to Object-Oriented Programming Figure 8.1 Figure 8.2 Figure 8.3 Figure 8.4 Figure 8.5 Figure 8.6 Figure 8.7 Figure 8.8 Figure 8.9 Figure 8.10 Figure 8.11 Capabilities tab In order to avoid getting an UnauthorizedAccessException when you access the microphone, you must ensure that the Microphone capability is checked Exercise 3 Create a new Universal app project Drag a Pivot control onto the design view Change the first PivotItem like this: Change the second PivotItem like this: Add a third PivotItem like this: Finally, navigate the web view control to a page you choose by calling Navigate in the constructor of the page: WebViewControl.Navigate(new Uri("http://www.wrox.com")); Beginning Visual C#® 2015 Programming Benjamin Perkins Jacob Vibe Hammer Jon D Reid Beginning Visual C#® 2015 Programming Published by John Wiley & Sons, Inc 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2016 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-119-09668-9 ISBN: 978-1-119-09655-9 (ebk) ISBN: 978-1-119-09656-6 (ebk) No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all warranties, including without limitation warranties of fi tness for a particular purpose No warranty may be created or extended by sales or promotional materials The advice and strategies contained herein may not be suitable for every situation This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services If professional assistance is required, the services of a competent professional person should be sought Neither the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002 Wiley publishes in a variety of print and electronic formats and by print-on-demand Some material included with standard print versions of this book may not be included in e-books or in print-on-demand If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com For more information about Wiley products, visit www.wiley.com Library of Congress Control Number: 2015957031 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its affi liates, in the United States and other countries, and may not be used without written permission Visual C# is a registered trademark of Microsoft Corporation All other trademarks are the property of their respective owners John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book About the Authors Benjamin Perkins (MBA, MCSD, ITIL) is currently employed at Microsoft in Munich, Germany, as a Senior Technical Advisor for IIS, ASP.NET, and Azure App Services He has been working professionally in the IT industry for over two decades He started computer programming with QBasic at the age of 11 on an Atari 1200XL desktop computer He takes pleasure in the challenges that troubleshooting technical issues have to offer and savors in the rewards of a well written program After completing high school he joined the United States Army After successfully completing his military service, he attended Texas A&M University in College Station, Texas, where he received a Bachelor of Business Administration in Management Information Systems His roles in the IT industry have spanned the entire spectrum including programmer, system architect, technical support engineer, team leader, and midlevel management While employed at Hewlett-Packard, he received numerous awards, degrees, and certifications He has a passion for technology and customer service and looks forward to troubleshooting and writing more world-class technical solutions “My approach is to write code with support in mind, and to write it once correctly and completely so we do not have to come back to it again, except to enhance it.” Benjamin is married to Andrea and has two wonderful children, Lea and Noa Jacob Vibe Hammer is a software architect and developer at Kamstrup, where he is helping the company develop world-class Smart Grid solutions for large public utilities He started programming just about the time when he was able to spell the word “BASIC” — which, incidentally, is the first programming language he ever used Since then, he has worked with numerous programming languages and solution architectures; however, since the turn of the century, he has worked primarily with the NET platform Today, his programming time is spent working primarily with C# and WPF, as well as toying with NoSQL databases A Danish citizen, Jacob lives in Aarhus, Denmark, with his wife and two sons Jon D Reid is a Product Solution Manager for IFS Field Service Management (www.IFSWORLD.com) He has coauthored a number of books, including Beginning Visual C# 2010, Fast Track C#, Pro Visual Studio NET, and many others About the Technical Editor John Mueller is a freelance author and technical editor He has writing in his blood, having produced 99 books and more than 600 articles to date The topics range from networking to artificial intelligence and from database management to heads-down programming Some of his current books include books on topics such as Python for beginners, Python for data scientists, and MATLAB He has also written a Java e-learning kit, a book on HTML5 development with JavaScript, and another on CSS3 His technical editing skills have helped more than 63 authors refine the content of their manuscripts John has provided technical editing services to both Data Based Advisor and Coast Compute magazines Be sure to read John's blog at http://blog.johnmuellerbooks.com/ Acknowledgments It takes a lot of work to get content into a presentable format for students and IT professionals to read and get value from The authors indeed have technical knowledge and experiences to share, but without the technical writers, technical reviewers, developers, editors, publishers, graphic designers, the list goes on, providing their valuable input, a book of high quality could not be written The rate of change occurs too quickly for an individual to perform all these tasks and still publish a book that is valid before the technology becomes stale This is why authors worked together with a great team to get all the components of the book together quickly It was done to ensure that the most up to date information gets to the reader while the features are still fresh and current I would like to thank Kelly Talbot for his great project management and technical review of the content as well as John Mueller for his technical review and suggestions throughout the process Lastly, I would like to thank all the numerous people behind the scenes who helped get this book together Credits Senior Acquisitions Editor Kenyon Brown Project Editor Kelly Talbot Technical Editor John Mueller Production Editor Joel Jones Copy Editor Kelly Talbot Editing Services Manager of Content Development & Assembly Mary Beth Wakefield Production Manager Kathleen Wisor Marketing Director David Mayhew Marketing Manager Carrie Sherrill Professional Technology & Strategy Director Barry Pruett Business Manager Amy Knies Associate Publisher Jim Minatel Project Coordinator, Cover Brent Savage Proofreader Nancy Bell Indexer Jack Lewis Cover Designer Wiley Cover Image © Nomad_Soul/Shutterstock WILEY END USER LICENSE AGREEMENT Go to www.wiley.com/go/eula to access Wiley's ebook EULA ... Chapter 10: Defining Class Members Figure 10. 1 Figure 10. 2 Figure 10. 3 Figure 10. 4 Figure 10. 5 Figure 10 .6 Figure 10. 7 Figure 10. 8 Figure 10. 9 Figure 10. 10 Figure 10. 11 Figure 10. 12 Figure 10. 13... Figure 16. 3 Figure 16. 4 Figure 16. 5 Figure 16. 6 Figure 16. 7 Figure 16. 8 Figure 16. 9 Figure 16. 10 Figure 16. 11 Figure 16. 12 Figure 16. 13 Figure 16. 14 Figure 16. 15 Chapter 17: Advanced Cloud Programing and Deployment... Chapter 9: Defining Classes Chapter 10: Defining Class Members Chapter 11: Collections, Comparisons, and Conversions Chapter 12: Generics Chapter 13: Additional C# Techniques Chapter 1 Introducing C# What you will learn in this chapter

Ngày đăng: 26/09/2021, 20:17

TỪ KHÓA LIÊN QUAN