Home > Topics > Programming > C#

C#

131 Items

Sort by Date | Title

Classes in C#
Oct 21, 2015
This chapter from Essential C# 6.0, 5th Edition introduces the basics of object-oriented programming using C#. A key focus is on how to define classes, which are the templates for objects themselves.
Using Static Methods and 'Better Betterness' in C# 6
Sep 7, 2015
Concluding his series on new and improved features in C# 6, Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, discusses new syntax for static methods that will really de-clutter your code, along with improved overload resolution that reduces ambiguity by helping the compiler to make better method-overload choices.
Await, Catch, and Finally in C# 6
Aug 31, 2015
Did you think await was allowed everywhere in earlier versions of C#? You're not alone. Now that the keyword is available in catch and finally clauses, Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, shows how to use the advantages await offers in exception-processing scenarios.
New Ways to Initialize Collections in C# 6
Aug 24, 2015
Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, shares the details of two enhancements in C# 6 for initializing collections, which read more naturally and bring associative containers into parity with sequence containers' initialization syntax.
Better Error Handling with the New Exception Filters in C# 6
Aug 17, 2015
The exception filters in C# 6 cut back on the cumbersome error-handling code commonplace to earlier releases. Of course, handling errors is part of the job, but new implementations in C# 6 can diminish the extra work. Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, details the changes in the new release.
Sharp Regrets: Top 10 Worst C# Features
Aug 12, 2015
Though C# has many great features, a handful could have been designed differently or omitted entirely, says Eric Lippert, who should know, because he served on the design committee. The co-author of Essential C# 6.0, Fifth Edition shares his personal top 10 (bottom 10?) C# design annoyances.
The New nameof Expressions in C# 6: Painless Conversion of Symbols to Strings
Aug 10, 2015
Translating symbol names into text is common in modern code. The task isn't exactly odious, but it still takes time, it's tedious, and it's easy to make mistakes. Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, happily skips all that work (and the associated runtime costs) with the help of the new nameof expression in C# 6.
A Pleasant New C# Syntax for String Interpolation
Aug 3, 2015
Does your C# code produce strings that combine text and computed values? The new features for string interpolation in C# 6 will make that code cleaner and clearer. Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, shares his enthusiasm for this new feature's ability to let you do more with less.
Using the New Null Conditional Operator in C# 6
Jul 23, 2015
Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, shows how to use the new null conditional operator in C# 6 to reduce code size, decrease bug counts, and make code more readable.
Auto Property Enhancements in C# 6
Jun 25, 2015
Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, demonstrates how enhancements in auto properties make it easier to express your design intent. This modern syntax helps your code's design to be cleaner and clearer, with a much more concise syntax for read-only properties.
C# 6: Expression Bodied Members Simplify Your Code
Jun 10, 2015
In a series of articles, Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, explores some of the powerful new features in Visual Studio 2015 that will soon become familiar friends. This article discusses how to simplify your C# code with the precise syntax of expression bodied members, saving time, keystrokes, and processor overhead.
Automate Your Development: Build Code Diagnostics and Code Fixes with the .NET Compiler Platform APIs
Mar 5, 2015
An important feature of the API framework in the Visual Studio 2015 compiler is the capability to create your own diagnostic, code fix, and refactoring projects. Bill Wagner, author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition, shows how you can use these APIs to automate everyday tasks such as finding code that lacks enclosing braces - and then adding them automatically.
Universal Windows Apps with XAML and C# Unleashed: Threading, Windows, and Pages
Feb 23, 2015
This chapter from Universal Windows Apps with XAML and C# Unleashed begins by examining a very important topic, although one that many developers take for granted: the threading model for universal apps. This background is especially helpful for the advanced feature of writing an app that displays multiple windows, which is the second topic in this chapter. The third and final topic—navigating between a window’s pages—is a feature leveraged by just about every real-world app.
A Brief Tour of C# 6.0
Feb 16, 2015
Are you eager for the release of C# 6.0? Bill Wagner is! The author of Effective C#: 50 Specific Ways to Improve Your C#, Second Edition discusses a few of his favorite new features, including some that you probably thought were already in the code, and other pleasant surprises.
Background Tasks in Windows 8.1
Jul 29, 2014
Windows Store apps are designed to remain alive and connected even when they are not running. Your app may need to fetch data from a remote server, download large files in the background, scan the file system for changes, or connect with a web service to retrieve updates while the user is performing other tasks. Fortunately, the Windows Runtime (WinRT) provides a mechanism referred to as background tasks that provides this functionality. In this article, Microsoft MVP for Silverlight Jeremy Likness shows you the variety of tasks that are available from updating information on the lock screen, raising alerts from incoming messages, to playing audio in the background and receiving data only when the connection is not metered.
Working with User Input Devices in the Windows Runtime
Jul 17, 2014
In this chapter from Programming the Windows Runtime by Example: A Comprehensive Guide to WinRT with Examples in C# and XAML, you see how the WinRT APIs provide a common model for working with the various kinds of input pointer devices. This model provides a range of access, allowing you not only to obtain information about raw pointer events, but also to work with higher-level abstract gestures, depending on the needs of your app. You also see how you can access keyboard events from your code and obtain information about the user’s key presses.
Building Breakernoid in MonoGame, Part 4
Mar 11, 2014
In the final article on how to create a clone of classic brick-breaking games using C# and MonoGame, Sanjay Madhav shows you how to add levels that load from XML, scoring, lives, and improved ball bouncing.
Building Breakernoid in MonoGame, Part 3
Mar 4, 2014
In the third of four articles on how to create a clone of classic brick-breaking games using C# and MonoGame, Sanjay Madhav shows you how to add some exciting power-ups, different color blocks, and sound effects to the game.
Building Breakernoid in MonoGame, Part 2
Feb 25, 2014
In the second of four articles on how to create a clone of classic brick-breaking games using C# and MonoGame, Sanjay Madhav guides you through the physics of ball movement and collisions with the paddle and blocks.
Building Breakernoid in MonoGame, Part 1
Feb 18, 2014
In the first of four articles on how to create a clone of classic brick-breaking games using C# and MonoGame, Sanjay Madhav walks you through setting up the basic infrastructure, creating a base game object class, and adding a moving paddle.

Page 1 2 3 4 5 Next >