advanced.net framework 2.0 david ringsell mcpd mcsd mct mcad

28
Advanced .Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Upload: connor-sparks

Post on 27-Mar-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Advanced .Net Framework 2.0

David Ringsell MCPD MCSD MCT MCAD

Page 2: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

INTRODUCTION

Page 3: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

ABOUT THIS COURSE

COURSE STYLE

Content has some flexibility Opportunity to experiment – extend the labs Opportunity to share knowledge Opportunity to enhance team working Answer your questions using MSDN Help & Visual Studio. Contribute – attempt consultants questions Enjoy the course!

Copyright David Ringsell 2007

Page 4: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

TRAINING METHODS

Talks with slides

Practical Demonstrations

Sample Code and exercises

Questions and answers – both ways

Discussions

Training notes – add your own notes

Page 5: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Course Evaluation

1. What is the best thing about this course?

2. The course be will even better if?

You can consider

Pace Technical depth Content Balance of activities (labs, talks, demonstrations) Course Materials

Page 6: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Course Content

Module 1: Creating Globalized Applications

Module 2: Working with GDI+ in Windows-based Applications

Module 3: Implementing Code Access Security

Module 4: Implementing Cryptography

Module 5: Interoperating Between COM Components and Assemblies

Module 6: Working with Service Applications and E-mail Messages

Module 7: Working with Type Metadata

Module 8: Creating Multithreaded Applications and Application Domains

Page 7: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Module 1: Creating Globalized

Applications

Page 8: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Overview

Working with Culture Information by Using Globalization Classes

Creating a Custom Culture

Working with Primary Encoding Classes

Working with Advanced Encoding Classes

Page 9: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lesson 1: Working with Culture Information by Using Globalization Classes

What Is Globalization?

How Culture Information Is Accessed by Using the CultureInfo Class

How Region Information Is Accessed by Using the RegionInfo Class

How Date/Time Values in a Culture Are Formatted by Using the DateTimeFormatInfo Class

How Numeric Values Are Formatted by Using the NumberFormatInfo Class

How Culture Information Is Compared by Using the CompareInfo Class

Discussion: How Culture Information Is Used

Page 10: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

What Is Globalization?

Designing a software application such that language and culture related content is separate from source code

Designing a software application such that language and culture related content is separate from source code

Globalization

Supplying the resources required for the application and displaying everything in the user interface in the localized language

Supplying the resources required for the application and displaying everything in the user interface in the localized language

Localization

Verifying that a globalized application is ready for localization Verifying that a globalized application is ready for localization Localizability

Page 11: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Culture Information Is Accessed by Using the CultureInfo Class

Class that you can use to createglobal applicationsClass that you can use to createglobal applicationsCultureInfo

Page 12: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Region Information Is Accessed by Using the RegionInfo Class

Class that represents specific country formats along with any customization defined in the Windows operating system

Class that represents specific country formats along with any customization defined in the Windows operating system

RegionInfo

Page 13: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Date/Time Values in a Culture Are Formatted by Using the DateTimeFormatInfo Class

Class that helps manipulate the date/time values and formats them according to the region

Class that helps manipulate the date/time values and formats them according to the region

DateTimeFormatInfo

mm/dd/yyyy

Page 14: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Numeric Values Are Formatted by Using the NumberFormatInfo Class

Class that helps format numeric values, in particular string formats depending on the culture

Class that helps format numeric values, in particular string formats depending on the culture

NumberFormatInfo

123456

789,000

Page 15: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Culture Information Is Compared by Using the CompareInfo Class

Class that helps perform a comparison of the strings that follow any regional order

Class that helps perform a comparison of the strings that follow any regional order

CompareInfo

Page 16: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lesson 2: Creating a Custom Culture

Describe the Role of the CultureAndRegionInfoBuilder Class

How a Custom Culture Is Built by Using the CultureAndRegionInfoBuilder Class

Discussion: Creating Custom Cultures

Page 17: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Describe the Role of the CultureAndRegionInfoBuilder Class

Class that helps you create a new culture based on certain formats and save the culture on the local computer or export it to an XML file

Class that helps you create a new culture based on certain formats and save the culture on the local computer or export it to an XML file

CultureAndRegionInfoBuilder

Page 18: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How a Custom Culture Is Built by Using the CultureAndRegionInfoBuilder Class

Dim custom As New CultureAndRegionInfoBuilder("en-Custom", CultureAndRegionModifiers.None)

custom.LoadDataFromCultureInfo(New CultureInfo("en-US"))

custom.NumberFormat.CurrencyDecimalDigits = 10custom.NumberFormat.CurrencyDecimalSeperator = "-"Dim size As Integer() = New Integer(0) {4}custom NumberFormat.CurrencyGroupSizes = sizecustom.LoadDataFromRegionInfo(New

RegionInfo("US"))custom.RegionEnglishName = "My Region English Name" custom.Register()

Following code example displays the building of a custom culture by using the CultureAndRegionInfoBuilder class:Following code example displays the building of a custom culture by using the CultureAndRegionInfoBuilder class:

Page 19: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lesson 3: Working with Primary Encoding Classes

What Is Character Encoding?

How Characters Are Encoded by Using the Encoding and EncodingInfo Classes

How Characters Are Encoded by Using ASCII and Unicode Standards

Discussion: Identifying the Features of ASCII and Unicode Encoding Classes

Page 20: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

What Is Character Encoding?

Process of converting a stream of text into a byte array mapped to a specific code pageProcess of converting a stream of text into a byte array mapped to a specific code pageEncoding

Process of converting a byte array mapped to a specific code page into a stream of textProcess of converting a byte array mapped to a specific code page into a stream of textDecoding

Page 21: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Characters Are Encoded by Using the Encoding and EncodingInfo Classes

Class that is the base class from which the actual implementations deriveClass that is the base class from which the actual implementations deriveEncoding

Class that provides basic information about a specific encodingClass that provides basic information about a specific encodingEncodingInfo

Page 22: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Characters Are Encoded by Using ASCII and Unicode Standards

Class that implements ASCII encoding and is not suited for sharing data between different languages

Class that implements ASCII encoding and is not suited for sharing data between different languages

ASCIIEncoding

Class that performs Unicode UTF-8 encoding and recognizes all Unicode characters from different languages

Class that performs Unicode UTF-8 encoding and recognizes all Unicode characters from different languages

UTF8Encoding

Class that represents the default encoding standard implemented by the .NET Framework 2.0

Class that represents the default encoding standard implemented by the .NET Framework 2.0

UnicodeEncoding

Page 23: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lesson 4: Working with AdvancedEncoding Classes

How Failure Events Are Handled by Using the Encoder and EncoderFallback Classes

How Failure Events Are Handled by Using the Decoder and DecoderFallback Classes

Discussion: Identifying the Purpose of Advanced Encoding Classes

Page 24: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Failure Events Are Handled by Using the Encoder and EncoderFallback Classes

Class that converts a set of characters to a sequence of bytesClass that converts a set of characters to a sequence of bytesEncoder

Base class of the EncoderExceptionFallback and EncoderReplacementFallback classes

Base class of the EncoderExceptionFallback and EncoderReplacementFallback classes

EncoderFallback

Page 25: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

How Failure Events Are Handled by Using the Decoder and DecoderFallback Classes

Process of converting a stream of text into a byte array mapped to a specific code pageProcess of converting a stream of text into a byte array mapped to a specific code pageEncoding

Process of converting the coded page to the relevant byte array or stream of text Process of converting the coded page to the relevant byte array or stream of text Decoding

Class that converts encoded bytes back into characters according to a specified encodingClass that converts encoded bytes back into characters according to a specified encodingDecoder

Base abstract class that provides an error-handling mechanismBase abstract class that provides an error-handling mechanismDecoderFallback

Page 26: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lab: Creating Globalized Applications

Exercise 1: Display Detailed Region Information and a Greeting for a Culture

Exercise 2: List all the Cultures Available

Page 27: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Lab Discussion

There may be many cultures available on your local system. However, where can you locate information about all the available culture codes, as well as additional information on culture, globalization, and localization standards?

Do all cultures follow the same rules for indexing?

Page 28: Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD

Review

This module described:This module described:

Working with culture informationby using globalization classes

Creating a custom culture

Working with primaryencoding classes

Working with advancedencoding classes

Working with culture informationby using globalization classes

Creating a custom culture

Working with primaryencoding classes

Working with advancedencoding classes