Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Sunday, May 27, 2012

.Net 4.5-The End of Microsoft .Net Framework Client Profile





Microsoft had introduced 2 Variants of the .net Frameworks till .Net Framework Version 4,the Complete Framework and the Client Profile which was only a subset of the the Complete Framework.

Why did Microsoft do it?

Since the Complete Framework had a large size Microsoft did not want the END user's to consider it annoying to download the complete framework to run applications developed in .Net.
Certain software's only used some parts of the framework.So client profile was created as a subset of the .Net Framework complete Edition.The client Profile did not support ASP.Net and the Advanced Web Programming.

Was Client Framework a Success?

The Straight forward answer is 'NO'.If you ask why just compare the size of the two packages.

 .NET Framework 4 32BIT + 64 bit Full  - 48.1 MB
 .NET Framework 4 Client Profile-   41.0 MB

Just a 7MB Difference.So this is where it failed,the users will find it comfortable to download the full framework as the sizes have a small difference.This also created confusion among common users regarding the different terms used.

But with the Release of the .NET Framework 4.5 Microsoft is putting an End to the Client Framework model.Microsoft has mentioned about this in their MSDN Article http://social.msdn.microsoft.com/search/en-us?query=compact+&x=0&y=0

Quoting from MSDN

Starting with the .NET Framework 4.5, the Client Profile has been discontinued and only the full redistributable package is available. Optimizations provided by the .NET Framework 4.5, such as smaller download size and faster deployment, have eliminated the need for a separate deployment package. The single redistributable streamlines the installation process and simplifies your app's deployment options.
 Thus us Developers and END Users will find it comfortable to download a single version rather than getting confused with all different versions around.




Thursday, November 24, 2011

The Unsolved 'This is Not a True Type Font' Exception in C# Revealed and the Final 'SOLUTION'

Almost all Forums have a Discussion relating to 'Only true type fonts are Supported.This is not a true Type Font' Exception thrown in C#/.NET when a non true type font or a true type font with invalid metadata is selected from a Font Dialog.
This exception occurs because GDI+ Only supports True Type fonts. Modern/open type fonts are  not Supported by C#.Open Type fonts has been created by merging the old True Type and PostScript Fonts, as the result the Open type font may have a true type or postscript specification.

Although the Font Dialog control was designed to filter out these Non True Type fonts by using ChooseFont() API call with the CF_TTONLY option ,some Fonts may represent or call themselves as true type fonts.These are the Fonts with bad/Invalid MetaData that causes the Exception.

The Solution???
Unfortunately there is NO SOLUTION,I have found articles on the web giving the following solutions these include
  • Setting FontDialog.AllowSimulations property to false.
  • Setting FontDialog.AllowScriptChange property to false
These don't solve the Problem,A person had reported this bug to MicroSoft and here is their Reply:


Posted by Microsoft
This is a GDI+ issue and no changes are planned to that code base, therefore we cannot fix this bug. 
Posted by Microsoft
The Microsoft Sub-status is now "Investigating" 
Posted by Microsoft 
Note to customer: This only seems to be an issue at design time. You *can* set the font to VisualUI at runtime. We will continue looking into this from the designer perspective. 
Posted by Microsoft
Thanks for reporting this bug, we have been able to repro this issue and are investigating. 
Posted by Microsoft
The Microsoft Sub-status is now "Reproduced"
Thanks for reporting this bug, we have been able to repro this issue and are investigating.



This was Reported in 2005 and there is not a solution yet.The only Solution that i can offer is designing your own custom font picker or font selector that displays only true type fonts using the FontFamily class that returns only valid true type fonts. 
See these links to get started
Custom Font Dialog in WPF
Color and Font Selector Project hosted at Code Project
So,these are the currently available solutions to the Invalid Font Problem of the Font Dialgo control in C#.
Comments are always appreciated.

Wednesday, November 9, 2011

A Good and free Custom Progress Bar Control with Adjustable Color for C#

The customization options for the progress bar control in .NET/C# is highly limited as the progress bar will take up the default color pattern/visual style of the current operating system.You cannot change the back color or fore color of the progress bar even though the IDE/Visual Studio offers such options.
When the program is executed since the visual styles are enabled the progress bar will take up the visual style of the current operating system.You can solve this iisue by disabling the visual styles for your application by removing this line

Application.EnableVisualStyles 

from your starting class,But doing this will make your application look classic.So How can you solve the progress bar color issue? A better option is to go for third party progress bar controls for c#.There are lots out there,but you got to pay for it.
Also there are some pretty impressive controls available for free.Progress Bar Plus

http://www.codeproject.com/KB/progress/ProgBarPlus.aspx is such a project hosted at CodeProject.


It offers variety of designs,colour patterns,shapes whatever you wnat for free.The implemetation instructions are provided at this link.The project is licensed under The Code Project Open License (CPOL) and is free to be used without paying a fortune.




Friday, October 7, 2011

Using DotNetZip to Compress all the Files in a Folder in C#

The inbuilt Compression class GzipStream class(System.IO.Compression) for C# does not provide the ability to compress all the files within a folder.You can do this by just few lines of code and just forgetting the techinical aspects behind it by using DotNetZip(Ioniczip).DotNetZip is a free class library that can be used for creating and editing zip files.

The project is Hosted at CodePlex check out http://dotnetzip.codeplex.com
To use DotNetZip Library in your C# Project follow these steps
  • Download the latest release from http://dotnetzip.codeplex.com/releases/
  • Add a Reference to DotNetZip from your project by going to Project> Add Reference .Browse for Ionic.Zip.dll in the release that you have downloaded.
  • Then add the reference in your project by adding the statement 'using Ionic.Zip'
  • Then use the code given below to create a zip file from a folder
 using (ZipFile zip = new ZipFile())  
 {  
   zip.AddDirectory(@"thefoldertoadd");  
   zip.Save("pathToSaveZipFile");  
 }  

Saturday, October 1, 2011

How to create a Toggle Button in C#(.NET)

Toggle Buttons are necessary controls that a programmer may require for developing winform applications,but
toggle button Control is not included in the Standard C# IDE as a Control but it can be created by using the CheckBox Control.

The following steps describes creating a Toggle Button Control from a check box Control in C#

  • Add a Check Box Control to the Windows Form Application Form from the Tool Box
     
  • Select the Check box and from the Property windows change the Property 'Appearance' from 'Normal' to 'Button'.
  • Done the Toggle Button is Created and is Ready to Go.To use it add the To Do code to its Check Changed Event.

Which is the Best Photo Watermarking Software

Photo Theft is becoming more and more common in the web with the outburst of social websites like Facebook,Google Plus and Image sharing se...