Advanced.Net Framework 2.0 David Ringsell MCPD MCSD MCT MCAD
INTRODUCTION
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
TRAINING METHODS Talks with slides Practical Demonstrations Sample Code and exercises Questions and answers – both ways Discussions Training notes – add your own notes
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
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 Messages Module 7: Working with Type Metadata Module 8: Creating Multithreaded Applications and Application Domains
Module 1: Creating Globalized Applications
Overview Working with Culture Information by Using Globalization Classes Creating a Custom Culture Working with Primary Encoding Classes Working with Advanced Encoding Classes
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
What Is Globalization? 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 Localization Verifying that a globalized application is ready for localization Localizability
How Culture Information Is Accessed by Using the CultureInfo Class Class that you can use to create global applications CultureInfo
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 RegionInfo
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 DateTimeFormatInfo mm/dd/yyyy
How Numeric Values Are Formatted by Using the NumberFormatInfo Class Class that helps format numeric values, in particular string formats depending on the culture NumberFormatInfo ,000
How Culture Information Is Compared by Using the CompareInfo Class Class that helps perform a comparison of the strings that follow any regional order CompareInfo
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
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 CultureAndRegionInfoBuilder
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 = 10 custom.NumberFormat.CurrencyDecimalSeperator = " - " Dim size As Integer() = New Integer(0) {4} custom NumberFormat.CurrencyGroupSizes = size custom.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:
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
What Is Character Encoding? Process of converting a stream of text into a byte array mapped to a specific code page Encoding Process of converting a byte array mapped to a specific code page into a stream of text Decoding
How Characters Are Encoded by Using the Encoding and EncodingInfo Classes Class that is the base class from which the actual implementations derive Encoding Class that provides basic information about a specific encoding EncodingInfo
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 ASCIIEncoding 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 UnicodeEncoding
Lesson 4: Working with Advanced Encoding 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
How Failure Events Are Handled by Using the Encoder and EncoderFallback Classes Class that converts a set of characters to a sequence of bytes Encoder Base class of the EncoderExceptionFallback and EncoderReplacementFallback classes EncoderFallback
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 page Encoding 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 encoding Decoder Base abstract class that provides an error- handling mechanism DecoderFallback
Lab: Creating Globalized Applications Exercise 1: Display Detailed Region Information and a Greeting for a Culture Exercise 2: List all the Cultures Available
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?
Review This module described: Working with culture information by using globalization classes Creating a custom culture Working with primary encoding classes Working with advanced encoding classes Working with culture information by using globalization classes Creating a custom culture Working with primary encoding classes Working with advanced encoding classes