Chapter: 7

Implementing globalization, drawing, and text manipulation functionality in a .NET Framework application

CurrencyManager

The CurrencyManager class has the ability to keep track of the current position of data within an array, collection or table that is to be bound to a user interface.

WindowsPrincipal

The WindowsPrincipal class allows a user code to check the group membership of a current Windows user. The IsInRole() method of the WindowsPrincipal class is used to manage the role-based security.

Format pattern

The u format pattern represents the UniversalSortableDateTimePattern using the format for universal time display. The U format pattern represents the Full date and time (long date and long time) using universal time.

Parse

Use one of the overloaded Parse methods of the DateTime Structure to convert a string into its equivalent date and time. Use the InvariantCulture of the CultureInfo class to get the CultureInfo that is culture-independent (invariant).

NeutralCultures

NeutralCultures are associated with a language but are not specific to a country/region.

AllowInnerWhite

The AllowInnerWhite member of the DateTimeStyles enumeration is used to ignore the extra white-space characters in the middle of any string during parsing.

Number

The Number member of NumberStyles is used to indicate that the AllowLeadingWhite, AllowTrailingWhite, AllowLeadingSign, AllowTrailingSign, AllowDecimalPoint, and AllowThousands styles are used.

AllowThousands

The AllowThousands member of the NumberStyles enumeration is used to indicate that the numeric string can have group separators, for example, separating the hundreds from the thousands.

DigitShapes

The DigitShapes enumeration is used to specify the culture-specific display of digits.

Solar calendar

A solar calendar is a calendar whose dates indicate the position of the earth on its revolution around the sun.

Format pattern

Use the “dddd” format pattern to represent a full name of a day of the week as defined in the current DateTimeFormatInfo.DayNames property.

MonthNames property

Use the “MMMM” format specifier to represent the full name of the month as defined in the current DateTimeFormatInfo.MonthNames property.

Standard format strings

The four standard format strings are as follows:

  • O (or o)
  • R (or r)
  • s
  • u
CultureInfo

The CultureInfo class is used to represent information about a specific culture including the language, the writing system, the calendar used, etc.

InvariantCulture

The InvariantCulture property of the CultureInfo class is culture-independent and is not associated with any specific country or region.

CurrencyPositivePattern

Develops an application for users who live in Australia and format pattern for positive currency values by implementing CurrencyPositivePattern property of the NumberFormatInfo class.

RegionInfo

Gather regional information about customers in a particular country by implementing RegionInfo class.

Culture attribute

The culture attribute of the globalization section is used to specify the default culture for processing incoming requests from an application.

ResourceManager

The ResourceManager class provides access to culture-specific resources at runtime. It looks up culture-specific resources, provides resource fallback when a localized resource does not exist, and supports resource serialization.

CurrentCulture property

Use the System.Threading.Thread.CurrentThread.CurrentCulture property to enable specific users to use the application.

SmallCaptionFont

The SmallCaptionFont property is used to get a font that is used to display text in the title bars of small windows such as tool window.

FontFamily and Font

Use the FontFamily and Font classes to constructs a regular style Arial font with a size of 18 pixels.

Graphics object

To create a Graphics object, you can perform any of the following actions:

  • Receive a reference to a Graphics object as a part of the PaintEventArgs of a control.
  • Call the CreateGraphics method of a control to obtain a reference to a Graphics object.
Graphics object

Create a Graphics object from any object that inherits from the Image class.

Antialiasing

Use the antialiasing with the graphics in an application by using the HighQuality and AntiAlias properties.

Dash property

Use the DashStyle.Dash property to specify a line consisting of dashes.

AccessibleName property

Make application accessible to low vision users by using the AccessibleName property to the accessibility aids (accessibility aids are specialized programs and devices, such as the Braille bar that help the users with disabilities to use computers more effectively).

Rich Text Format

Use the license agreement to store contents in the Rich Text Format (RFT) file and add the file to a setup project and also enhance user interface using the license agreement policy.

Bitmap class

The Bitmap class can be used to change the color of an image.

PaintEventArgs class

Implementing PaintEventArgs class and draw a line on a pictureBox control using the DrawLine() method.

Brushes class

The Brushes class contains static properties that allow a user to get a Brush object of different colors.

Color class

Use the Color class and display a given text with specified brush color on a window.

Icon

The Icon class contains nine constructors.

LineJoin

The LineJoin enumeration is used to specify how to join consecutive lines or curve segments.

FillRectangles

The FillRectangles method of the SolidBrush class is used to fill the interior of a rectangle.

Display statistical date

Display statistical date in graphical format and use a custom graphing control that does not support resizing and ensure that users cannot resize, minimize, or maximize Form.

MinimumSize

The MinimumSize property of the Form class is used to get or set the minimum size up to which a form can be resized. The Size property of the Form class is used to get or set the size of a form.

Character escape

The \u0020 character escape is used to match a Unicode character using hexadecimal numbers.

Wildcard character

The * wildcard character is used to match the preceding character or sub expression zero or more times. For example, “te*” matches “te” and “test”. The “*” character is equivalent to “{0,}”.

Wildcard character

The . wildcard character is used to match any single character except “\n”. To match any character including the “\n”, use a pattern such as “[\s\S]“.

Character

The \G character is used to specify that the match must occur at the point where the previous match ended.

StringBuilder

Create a StringBuilder object and initialize it with a given string and set capacity to 75. Use the AppendFormat method of the StringBuilder class to append a formatted string at the end of the StringBuilder object.

Traditional

The Traditional member of the StringDigitSubstitute enumeration is used to specify substitution digits that correspond with the user’s native script or language.

Regular expressions

Regular expressions are the most effective way to verify the format of the data that matches a phone number.

Carrot

The carrot (^) character is used to specify that the match must begin at either the first character of a string or the last character of a line.

Character

The \b character is used to specify that the match must occur on a boundary between \w (alphanumeric) and \W (nonalphanumeric) characters.

Unicode

The UTF8Encoding, UnicodeEncoding, and UTF32Encoding classes are better suited for global applications. The ASCIIEncoding class supports only the Unicode character values between U+0000 and U+007F.

AppendLine

The AppendLine method is used to append the default line terminator or a specified string to the end of the StringBuilder object.

Match

The Match method is used to search an input string for an occurrence of a regular expression and it will return the results as a single Match object.

StringBuilder

The StringBuilder class represents dynamic or mutable strings of characters, it represents a string-like object whose value is changeable.

Graphics object

The four objects that can be used with a Graphics object are as follows:

  • Pen
  • Color
  • Brush
  • Font
Substring

The Substring() method of the String class retrieves substring from a given string.

Share
Tagged with:
 

Leave a Reply