Introduction
Compact .NET Framework Arabic Enabled Assemblies allow .NET developers to create Arabic enabled applications without using any other external software.
Background
The idea was born while I was working on a Symbol handheld creating shelf prices' checker and labels printing software for Windows CE 5.0. I was required to retrieve, display and print Arabic (Hindi) numbers and context.
Using the Code
This code is a sample code for design-time controls.
This project is complete but it would need some modifications depending on your needs:
using System.Drawing;
using System.Windows.Forms;
using System.Text;
namespace Ar.Controls
{
public class ArabicButton : System.Windows.Forms.Button
{
private bool m_HindiNumerals;
private string m_LogicalText;
private bool m_RightToLeft;
public bool HindiNumerals
{
get
{
return this.m_HindiNumerals;
}
set
{
this.m_HindiNumerals = value;
this.Text = this.m_LogicalText;
}
}
public new bool RightToLeft
{
get
{
return this.m_RightToLeft;
}
set
{
this.m_RightToLeft = value;
this.Text = this.m_LogicalText;
}
}
public new string Text
{
get
{
return this.m_LogicalText;
}
set
{
if (value != null)
{
this.m_LogicalText = value;
StringBuilder builder1 =
new StringBuilder(this.Text.Length + 1);
short num1 = (short) this.m_LogicalText.Length;
ushort[] numArray1 = new ushort[1];
if (this.m_HindiNumerals)
{
numArray1[0] = 1;
}
else
{
numArray1[0] = 0;
}
mArabicCoreWrapper.BuildArabicStringWithLigate
(this.m_RightToLeft, this.Text, builder1, num1, numArray1);
base.Text = builder1.ToString();
}
}
}
public override System.Drawing.Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Invalidate();
}
}
public ArabicButton()
{
this.m_RightToLeft = true;
this.m_HindiNumerals = true;
}
} }
It was written for compact framework version 2.0, tested on Windows CE 5.0 and Windows Mobile 5.0.
Points of Interest
Arabic is a very complicated and beautiful language. I hope to use this language in programming instead of English.
History
This project started earlier in 2005 and it sure needs some modifications.
- 11/5/2009: Added mArabicCore in the article attachments