This article is an incremental version of its base article Globalized property grid. It discusses the localization of category names and localized property names in case of inheritance.
|
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace GlobalizedPropertyGrid
{
/// <summary>
/// Person is the test class defining two properties: first name and last name .
/// By deriving from GlobalizedObject the displaying of property names are language aware.
/// GlobalizedObject implements the interface ICustomTypeDescriptor.
/// </summary>
public class Person : GlobalizedObject
{
private string firstName = "";
private string lastName = "";
private int age = 0;
public Person() {}
[GlobalizedCategory("Required")]
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
// Uncomment the next line to see the attribute in action:
[GlobalizedCategory("Required")]
// [GlobalizedProperty("Surname",Description="ADescription",Table="GlobalizedPropertyGrid.SpecialStringTable")]
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
[GlobalizedCategory("Optional")]
public int Age
{
get { return age; }
set { age = value; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
For ten years I worked as a senior consultant, coach, lead architect and project lead for several consulting companies.
Currently I work as a system architect for
Zuehlke Engineering GmbH based in Frankfurt.
You can find a detailed resume
here.