Viser: Head First C#

Head First C#

Head First C#

Jennifer Greene og Andrew Stellman
(2013)
Sprog: Engelsk
O'Reilly Media, Incorporated
498,00 kr.
Denne titel er udgået og kan derfor ikke bestilles. Vi beklager.

Detaljer om varen

  • Paperback: 1100 sider
  • Udgiver: O'Reilly Media, Incorporated (Oktober 2013)
  • Forfattere: Jennifer Greene og Andrew Stellman
  • ISBN: 9781449343507
Head First C# is a complete learning experience for learning how to program with C#, XAML, the .NET Framework, and Visual Studio. Fun and highly visual, this introduction to C# is designed to keep you engaged and entertained from first page to last.



Youll build a fully functional video game in the opening chapter, and then learn how to use classes and object-oriented programming, draw graphics and animation, and query data with LINQ and serialize it to files. And you'll do it all by creating games, solving puzzles, and doing hands-on projects. By the time you're done, you'll be a solid C# programmerand you'll have a great time along the way!



  • Create a fun arcade game in the first chapter, and build games and other projects throughout the book

  • Learn how to use XAML to design attractive and interactive pages and windows

  • Build modern Windows Store apps using the latest Microsoft technology

  • Learn WPF (Windows Presentation Foundation) using the downloadable WPF Learner's Guide

  • Using the Model-View-ViewModel (MVVM) pattern to create robust architecture

  • Build a bonus Windows Phone project and run it in the Visual Studio Windows Phone emulator


Projects in the book work with all editions of Visual Studio, including the free Express editions.

;Advance Praise for Head First C#;Praise for other Head First books; ;How to Use this Book: Intro; Who is this book for?; We know what you''re thinking.; And we know what your brain is thinking; Metacognition: thinking about thinking; Here''s what WE did; Here''s what You can do to bend your brain into submission; Read me; What version of Windows are you using?; The technical review team; Acknowledgments; Safari® Books Online;
Chapter 1: Start Building with C#: Build something cool, fast!;
1.1 Why you should learn C#;
1.2 C# and the Visual Studio IDE make lots of things easy;
1.3 What you do in Visual Studio...;
1.4 What Visual Studio does for you...;
1.5 Aliens attack!;
1.6 Only you can help save the Earth;
1.7 Here''s what you''re going to build;
1.8 Start with a blank application;
1.9 Set up the grid for your page;
1.10 Add controls to your grid;
1.11 Use properties to change how the controls look;
1.12 Controls make the game work;
1.13 You''ve set the stage for the game;
1.14 What you''ll do next;
1.15 Add a method that does something;
1.16 Fill in the code for your method;
1.17 Finish the method and run your program;
1.18 Here''s what you''ve done so far;
1.19 Add timers to manage the gameplay;
1.20 Make the Start button work;
1.21 Run the program to see your progress;
1.22 Add code to make your controls interact with the player;
1.23 Dragging humans onto enemies ends the game;
1.24 Your game is now playable;
1.25 Make your enemies look like aliens;
1.26 Add a splash screen and a tile;
1.27 Publish your app;
1.28 Use the Remote Debugger to sideload your app;
1.29 Start remote debugging;
Chapter 2: It''s all Just Code: Under the hood;
2.1 When you''re doing this...;
2.2
...the IDE does this;
2.3 Where programs come from;
2.4 The IDE helps you code;
2.5 Anatomy of a program;
2.6 Two classes can be in the same namespace;
2.7 Your programs use variables to work with data;
2.8 C# uses familiar math symbols;
2.9 Use the debugger to see your variables change;
2.10 Loops perform an action over and over;
2.11 if/else statements make decisions;
2.12 Build an app from the ground up;
2.13 Make each button do something;
2.14 Set up conditions and see if they''re true;
2.15 Windows Desktop apps are easy to build;
2.16 Rebuild your app for Windows Desktop;
2.17 Your desktop app knows where to start;
2.18 You can change your program''s entry point;
2.19 When you change things in the IDE, you''re also changing your code;
Chapter 3: Objects: Get Oriented!: Making code make sense;
3.1 How Mike thinks about his problems;
3.2 How Mike''s car navigation system thinks about his problems;
3.3 Mike''s Navigator class has methods to set and modify routes;
3.4 Use what you''ve learned to build a program that uses a class;
3.5 Mike gets an idea;
3.6 Mike can use objects to solve his problem;
3.7 You use a class to build an object;
3.8 When you create a new object from a class, it''s called an instance of that class;
3.9 A better solution...brought to you by objects!;
3.10 An instance uses fields to keep track of things;
3.11 Let''s create some instances!;
3.12 Thanks for the memory;
3.13 What''s on your program''s mind;
3.14 You can use class and method names to make your code intuitive;
3.15 Give your classes a natural structure;
3.16 Class diagrams help you organize your classes so they make sense;
3.17 Build a class to work with some guys;
3.18 Create a project for your guys;
3.19 Build a form to interact with the guys;
3.20 There''s an easier way to initialize objects;
3.21 A few ideas for designing intuitive classes;
Chapter 4: Types and References: It''s
10:00. Do you know where your data is?;
4.1 The variable''s type determines what kind of data it can store;
4.2 A variable is like a data to-go cup;
4.3 10 pounds of data in a 5-pound bag;
4.4 Even when a number is the right size, you can''t just assign it to any variable;
4.5 When you cast a value that''s too big, C# will adjust it automatically;
4.6 C# does some casting automatically;
4.7 When you call a method, the arguments must be compatible with the types of the parameters;
4.8 Debug the mileage calculator;
4.9 Combining = with an operator;
4.10 Objects use variables, too;
4.11 Refer to your objects with reference variables;
4.12 References are like labels for your object;
4.13 If there aren''t any more references, your object gets garbage-collected;
4.14 Multiple references and their side effects;
4.15 Two references means TWO ways to change an object''s data;
4.16 A special case: arrays;
4.17 Arrays can contain a bunch of reference variables, too;
4.18 Welcome to Sloppy Joe''s Budget House o'' Discount Sandwiches!;
4.19 Objects use references to talk to each other;
4.20 Where no object has gone before;
4.21 Build a typing game;
4.22 Controls are objects, just like any other object;C# Lab: A Day at the Races;
Chapter 5: Encapsulation: Keep your privates... Private;
5.1 Kathleen is an event planner;
5.2 What does the estimator do?;
5.3 You''re going to build a program for Kathleen;
5.4 Kathleen''s test drive;
5.5 Each option should be calculated individually;
5.6 It''s easy to accidentally misuse your objects;
5.7 Encapsulation means keeping some of the data in a class private;
5.8 Use encapsulation to control access to your class''s methods and fields;
5.9 But is the RealName field REALLY protected?;
5.10 Private fields and methods can only be accessed from inside the class;
5.11 A few ideas for encapsulating classes;
5.12 Encapsulation keeps your data pristine;
5.13 Properties make encapsulation easier;
5.14 Build an application to test the Farmer class;
5.15 Use automatic properties to finish the class;
5.16 What if we want to change the feed multiplier?;
5.17 Use a constructor to initialize private fields;
Chapter 6: Inheritance: Your object''s family tree;
6.1 Kathleen does birthday parties, too;
6.2 We need a BirthdayParty class;
6.3 Build the
Part y Planner version
2.0;
6.4 One more thing...can you add a $100 fee for parties over 12?;
6.5 When your classes use inheritance, you only need to write your code once;
6.6 Build up your class model by starting general and getting more specific;
6.7 How would you design a zoo simulator?;
6.8 Use inheritance to avoid duplicate code in subclasses;
6.9 Different animals make different noises;
6.10 Think about how to group the animals;
6.11 Create the class hierarchy;
6.12 Every subclass extends its base class;
6.13 Use a colon to inherit from a base class;
6.14 We know that inheritance adds the base class fields, properties, and methods to the subclass...;
6.15 A subclass can override methods to change or replace methods it inherited;
6.16 Any place where you can use a base class, you can use one of its subclasses instead;
6.17 A subclass can hide methods in the superclass;
6.18 Use the override and virtual keywords to inherit behavior;
6.19 A subclass can access its base class using the base keyword;
6.20 When a base class has a constructor, your subclass needs one, too;
6.21 Now you''re ready to finish the job for Kathleen!;
6.22 Build a beehive management system;
6.23 How you''ll build the beehive management system;
6.24 Use inheritance to extend the bee management system;
Chapter 7: Interfaces and Abstract Classes: Making classes keep their promises;
7.1 Let''s get back to bee-sics;
7.2 We can use inheritance to create classes for different types of bees;
7.3 An interface tells a class that it must implement certain methods and properties;
7.4 Use the interface keyword to define an interface;
7.5 Now you can create an instance of NectarStinger that does both jobs;
7.6 Classes that implement interfaces have to include ALL of the interface''s methods;
7.7 Get a little practice using interfaces;
7.8 You can''t instantiate an interface, but you can reference an interface;
7.9 Interface references work just like object references;
7.10 You can find out if a class implements a certain interface with "is";
7.11 Interfaces can inherit from other interfaces;
7.12 The RoboBee 4000 can do a worker bee''s job without using valuable honey;
7.13 is tells you what an object implements; as tells the compiler how to treat your object;
7.14 A CoffeeMaker is also an Appliance;
7.15 Upcasting works with both objects and interfaces;
7.16 Downcasting lets you turn your appliance back into a coffee maker;
7.17 Upcasting and downcasting work with interfaces, too;
7.18 There''s more than just public and private;
7.19 Access modifiers change visibility;
7.20 Some classes should never be instantiated;
7.21 An abstract class is like a cross between a class and an interface;
7.22 Like we said, some classes should never be instantiated;
7.23 An abstract method doesn''t have a body;
7.24 Polymorphism means that one object can take many different forms;
Chapter 8: Enums and Collections: Storing lots of data;
8.1 Strings don''t always work for storing categories of data;
8.2 Enums let you work with a set of valid values;
8.3 Enums let you represent numbers with names;
8.4 We could use an array to create a deck of cards...;
8.5 Arrays are hard to work with;
8.6 Lists make it easy to store collections of...anything;
8.7 Lists are more flexible than arrays;
8.8 Lists shrink and grow dynamically;
8.9 Generics can store any type;
8.10 Collection initializers are similar to object initializers;
8.11 Let''s create a List of Ducks;
8.12 Lists are easy, but SORTING can be tricky;
8.13 IComparablehelps your list sort its ducks;
8.14 Use IComparer to tell your List how to sort;
8.15 Create an instance of your comparer object;
8.16 IComparer can do complex comparisons;
8.17 Overriding a ToString() method lets an object describe itself;
8.18 Update your foreach loops to let your Ducks and Cards print themselves;
8.19 You can upcast an entire list using IEnumerable;
8.20 You can build your own overloaded methods;
8.21 Use a dictionary to store keys and values;
8.22 The dictionary functionality rundown;
8.23 Build a program that uses a dictionary;
8.24 And yet MORE