Archive for December, 2005

.NET 2 Links

December 31st, 2005 by koolb | No Comments | Filed in Uncategorized

Found some good reference material for .NET 2.0 today.
They are as follows
Visual Studio 2005 and .NET Framework 2.0 Setup Troubleshooting Guide
ASP.NET jumpstarted: Establishing the Application and Page Framework
Visual Studio 2005 Class DesignerNew dataset Features in Visual Studio 2005
http://www.c-sharpcorner.com/vs2005.asp
Brian Goldberg Blog    

Now there is a page for ASP.NET UI Designers as well. You can find info on how to design your page according to web standards, Themes master pager etc. So Asela (Who is our UI designer at office) be ready, I’m going to bug you to implement them.
ASP.NET for Designers

    

UK government gateway runs totally on Microsoft software

December 29th, 2005 by koolb | No Comments | Filed in Uncategorized

I just found that UK government gateway runs totally on Microsoft software. It runs on top of Windows 2000 Advanced Server using BizTalk Server 2000, SQL Server 2000, Internet Security and Acceleration Server 2000, Application Center 2000, and Commerce Server 2000. According to Microsoft, this was there largest BizTalk server implementation. Even though the Linux community criticize this, It has proven that the Stability and Practicality of Microsoft solutions. This would be a good reference for me to convince customers for .NET Framework based applications.

More @ http://www.ciber-uk.com/casestudies/search_results_single.cfm?id=ukonline

.NET Localization

December 13th, 2005 by koolb | No Comments | Filed in Uncategorized

[ C#, .NET 1.1, 2.0 ]

We can do this by using resource files. A default resource file is generated for every form and text, images etc will be stored in this file and they are complied in to a satellite assembly. Custom text which you need to display as messages etc can be embedded in to custom resource file. You have to create this file manually.

To create multi language form first you have to set the Localize property to true;

Then you can add controls to the form. These controls will be added in the default language. Then you can change the language property to the language that you want and enter text in the form. This will result creating two resource file for the Form by the designer with there culture-name. At the compile time multiple assemblies are created for each culture. When you change the current culture form the Regional Settings the form will load with the specific language text that you added to the form.

Custom resource files will act as the same way, but you have to manually name them accordingly. Ex. Messages.resx , Meesages.fr-FR.resx

You have to load them in the following way

private void button1_Click(object sender, EventArgs e)

{

ResourceManager localResMgr = new ResourceManager(“GraphicsTest.messages”, typeof(TestWinControls).Assembly);

string welcomeMsg = localResMgr.GetString(“strWelcomeMessage”);

MessageBox.Show(welcomeMsg);

}

To check this you have to manually change the UI Culture of the form. You have to change the current threads’ UI culture in the Constructor of the Form before the Initializecomponent method is called.


public TestWinControls()

{

System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(“fr-FR”);

InitializeComponent();

}

Note: When you deploy the application the OS should be Win2k , Win3K or WinXP Multi-Language version and you should be able to change the UI Culture from the control panel.

.NET Graphics

December 9th, 2005 by koolb | No Comments | Filed in Uncategorized

I saw some enhanced controls created using the “Owner Drawn” feature of Winforms.NET 2.0. So I open the MSDN and start studying System.Drawing form the scratch. I found out that you have to get the Graphics object from the current control to draw graphics in the form and there are 3 methods to do that.

1. Graphic property of the PaintEventArgs, of the Paint event of the control

2. Calling CreateGraphics() method of the control

3. Getting the Graphic object a image using Graphics.FromImage(<class derived from image class>)

To check this I used the onPaint event of the PictureBox control as follows

I saw some enhanced controls created using the “Owner Drawn” feature of Winforms.NET 2.0. So I open the MSDN and start studying System.Drawing form the scratch. I found out that you have to get the Graphics object from the current control to draw graphics in the form and there are 3 methods to do that.

1. Graphic property of the PaintEventArgs, of the Paint event of the control

2. Calling CreateGraphics() method of the control

3. Getting the Graphic object a image using Graphics.FromImage()

To check this I used the onPaint event of the PictureBox control as follows

private void pictureBox1_Paint(object sender, PaintEventArgs e)

{

//Get a graphic object of the picturebox

Graphics graphicsRef = e.Graphics;

//Create a brush

System.Drawing.Brush brush = System.Drawing.Brushes.DarkOrange;

//Draw some text

graphicsRef.DrawString(“This is a Sample Text”, new Font(“Forte”, 14), brush, new Point(30, 30));

//Draw a line

graphicsRef.DrawLine(System.Drawing.Pens.BurlyWood, new Point(30, 60), new Point(100, 60));

}

Which generate a output like…









Furhter to add a Liner gradient to the text drawn in the screen I replaced the follwing line

//Create a brush

System.Drawing.Brush brush = System.Drawing.Brushes.DarkOrange;

With the

//Create a linear for the string

System.Drawing.Brush brush = new System.Drawing.Drawing2D.LinearGradientBrush(

new Point(30, 30),

new Point(200, 30),

Color.FromArgb(255, 0, 255, 0), // Opaque Green

Color.FromArgb(255, 0, 0, 255)); // Opaque blue

To generate an output like…