Monday, April 14, 2008

Farsi Library - Version 2.0 now available

Version 2.0 of FarsiLibrary is now available. The following changes are made in this release :

  • Modified : Migrated to Visual Studio .NET 2008. Still using .NET Framework 2.0, so you just need the new IDE to compile. Might affect clients using old .NET Framework 2.0 (without the new SP Installed).

  • Modified : IComparer and IComparer are converted to explicit implementation in PersianDate class.

  • Modified : ICloneable interface implementation is converted to explicit implementation in PersianDate class.

  • Modified : Assign method of PersianDate to internal.

  • Modified : Changed the Day/Month/Year change eventhandler type to EventHandler. You can use the New/Old value properties to access the underlying values.

  • Modified : FALocalizeManager now is a singleton class. Use the Instance property instead of static methods.

  • Modified : FAMessageBoxManager.Delete method now returns boolean value based on whether the delete operation was successful or not.



  • Added : Implementation of IsLeapMonth method in PersianCalendar.

  • Added : Solution Items folder.

  • Added : Partial Office 2007 Blue theme. Drawing of dropdown buttons of FADatePicker control need a better visualization.

  • Added : PainterFactory to create painters based on the state of BaseStyledControl.

  • Added : FAMessageBox now implementes IDisposable interface explicitly. Dispose method is made internal.



  • Fixed : When changing the culture, Year value didn't change, e.g. when in Farsi culture in year 1385 culture is set to english, the year remain 1385 (which was a valid year in English calendar).

  • Fixed : When changing the DefaultCulture property, Day and Month properties did not return the culture-specific values.
  • Fixed : A bug when accessing Now property of PersianDate class.

Please report any bug you might encounter. You can download the source code from here and the binary (including test project executables) from here.

More information about this project can be found on my Code Project article at here.
Submit this story to DotNetKicks Shout it

16 comments:

Minoo Moosavi said...

I can not download from this link. Please update prev version in CodeProject. Thanks a lot.

Hadi Eskandari said...

The link is fixed. You should have no problem downloading the files now.

hamed said...

salam jenab eskandari
agha aval az kare besiyar besiyar ghashanget tashakor konam
man hodod 1 sal (yekam kamtar az yek sal )hast ke az FarsiLibrary shoma estefadeh mikoanam khali ali hast
ama ye chand ta eshkal kochik dasht ke fekr konam hal kardin
chand ta pishnahad ham man bedam:
1.man dar khali az mavaghe niyaz daram ke vaghti tarikhi entekhab mishe 5 ragham akhar ro begiram va zakhire konam ... ke alan in karo
ba substring anjam midam age metodi vase inkar bezarin ali mishe
2.mesle ye maskeditbox ham amal kone yani age taraf nakhast // ro khodesh bendaze va nazare character gheir mojaz begire (albate moghei ke 5 ragham ham mikhaeim tosh benevisim faghat(mm/dd)ham javab bedeh)
baz ham tashakor mikonam azat ma khodam 2 ta datapiker dorost kardeh bodam ama ba didan in ona ro bikhiyal shodam

agha rasti man nemitonam in FarsiLibrary 2.0 ro download konam zaheran moshkeli vase linkesh pish omadeh ?! jaryan chiye?

Anonymous said...

agha kam daghati az khodam bod
link download on paein bod man ro khode title click mikardam ke mano dobare be hamin safhe pass midad

Maryam said...

Do you have a WPF version of calendar library?

Hadi Eskandari said...

the WPF version is at CodeProject web site. If you find any bugs please report them and I'll post updates here.

Maryam said...

Thanks a lot, I got it and I really need it.

abdkok said...

Hi Mr Eskandari
I Check code project for any updates and cant find anything.

Can you please give me exact url to download this new version.

Thanks for your great code.

Alon said...

Hi,

Thanx for what looks like a fantastic control !
I am however getting errors adding the controls (any / all) of them to my VS2008 project.
It is the same error that was reported on CodeProject - I commented there too.

Any help would be greatly appreciated.

Hadi Eskandari said...

I have not encountered this problem on the computers I've ran this component, and believe me, there were many of them! If you can, run the sample applications, or try to see if you add it programatically to a form, it would run or not? Do you only have the problem of adding it to your toolbox? Could you send me a stack trace of the exception you're receiving? I'll see what I can do.

Alon said...

Hi Hadi,

After commenting out the reference to the AssemblyKeyFile in the CommonAssemblyInfo file, I was able to compile the programs on my PC.
When I opened your solution (all the projects included) I can see the toolbar icons for the various controls.
If I try and open any of the demo forms in the project - I get errors:
Object reference not set to an instance of an object.
The stack trace for this is:
at FarsiLibrary.Win.Drawing.Office2003Colors.GetLightColor(Int32 btnFaceColorPart, Int32 highlightColorPart, Int32 windowColorPart) in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 237
at FarsiLibrary.Win.Drawing.Office2003Colors.InitStandardColors() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 184
at FarsiLibrary.Win.Drawing.Office2003Colors.Init() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 139
at FarsiLibrary.Win.Drawing.Office2003Colors..ctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 57
at FarsiLibrary.Win.Drawing.Office2003Colors..cctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 50

If I run the demo application, and click on any of the buttons, this is the stacktrace that I get:
System.TypeInitializationException was unhandled
Message="The type initializer for 'FarsiLibrary.Win.Drawing.Office2003Colors' threw an exception."
Source="FarsiLibrary.Win"
TypeName="FarsiLibrary.Win.Drawing.Office2003Colors"
StackTrace:
at FarsiLibrary.Win.Drawing.Office2003Colors.get_Default()
at FarsiLibrary.Win.BaseClasses.BaseStyledControl..ctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\BaseClasses\BaseStyledControl.cs:line 49
at FarsiLibrary.Win.Controls.FAMonthView..ctor(Boolean popupMode) in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Controls\FAMonthView.cs:line 576
at FarsiLibrary.Win.Controls.FAMonthView..ctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Controls\FAMonthView.cs:line 605
at FarsiLibrary.Test.frm01.InitializeComponent() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Test\frm01.Designer.cs:line 35
at FarsiLibrary.Test.frm01..ctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Test\frm01.cs:line 20
at FarsiLibrary.Test.MainForm.btnThemes_Click(Object sender, EventArgs e) in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Test\MainForm.cs:line 57
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at FarsiLibrary.Test.Program.Main() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Test\Program.cs:line 21
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.NullReferenceException
Message="Object reference not set to an instance of an object."
Source="FarsiLibrary.Win"
StackTrace:
at FarsiLibrary.Win.Drawing.Office2003Colors.GetLightColor(Int32 btnFaceColorPart, Int32 highlightColorPart, Int32 windowColorPart) in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 237
at FarsiLibrary.Win.Drawing.Office2003Colors.InitStandardColors() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 184
at FarsiLibrary.Win.Drawing.Office2003Colors.Init() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 139
at FarsiLibrary.Win.Drawing.Office2003Colors..ctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 57
at FarsiLibrary.Win.Drawing.Office2003Colors..cctor() in C:\Development\DotNet\TestingStuff\NullableDTP\FarsiLibrary.Win\Drawing\Office2003Colors.cs:line 50
InnerException:

I hope this helps.

You can contact me (via email) if you need more information etc. on alon dot hirsch at ebam dot co dot za

Thanx,

همسفر said...

salam
shoma baraye init kardan az system data haei migirid.
vaghti theme system default windows nabashe, va chizhaye motafareghe bashe, exception dade mishe va kolan fail mishe

in error az aval boode va raf` nashode

zahmat mikeshid age bartaraf konid. chon barnameye neveshte shode age jaei run beshe ke theme taghir karde kollan run nemishe

گون said...

سلام
زمانی که تقویم تو مد فارسی کار می کنه و شما تاریخ مربوط به آخر ماه رو وارد کنید (1387/06/31) و قراره تاریخ وارد شده به میلادی تبدیل بشه برنامه پیام خطا میده

Hadi Eskandari said...

Please use the latest version (nightly build, not released) here : http://cid-4962b6ceabc2cbd7.skydrive.live.com/self.aspx/BlogFiles/Farsi%20Library/FarsiLibrary-NightlyBuild-09-June-2009.zip

Anonymous said...

سلام دوباره
آقای اسکندری من توی این ورژن آخری تغییرات زیادی رو دیدم نسبت به نسخه 2.1 که قبلا باهاش کار می کردم اگه خاطرتون باشه قبلا هم در این مورد باهم یه مکاتبات اینترنتی داشتیم که منجر به قراردادن یه مثال با وی بی دات نت 2003 شد . تو این ورژن جدیده دیدم که کادر پیام فارسی اضافه شده ممنون می شم که فایل کمک واسه ورژن جدید رو قرار بدید یا اگه مثل قبل یه مثال واسه وی بی قرار بدین شرمنده می کنید . پیشاپیش ازتون تشکر می کنم

Anonymous said...

salam
chera dar Version haye jadid vaghti isreadonly=true dige hata ruye button ham nemishe click kard ke tarikh entekhab kard dar surati ke dar version haye ghadim mishod?

baraye inke nazarim benevise vali betune entekhab kone bayad chekar kard?