Hadi Eskandari (gravatar)

Farsi Library - Version 2.0 now available Monday, April 14, 2008

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.

Filed under
Feed Delicious Diggit Reddit Stumble
20 Comments
  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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?

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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.

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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,

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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 (gravatar)

    HEskandari said
    September 16, 2009

    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.

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    Do you have a WPF version of calendar library?

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

    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?

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • Hadi Eskandari (gravatar)

    HEskandari said
    September 16, 2009

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

  • arman (gravatar)

    arman said
    February 01, 2010

    salam

    emroz 12 bahmane 88 hast va 2shanbe niz hast . ke moadele monday, mibashad. vali dar calendar ke farsi mikonim shanbe ro neshon mide. version jadid ro ham test kardam. chetori in moshkel bartaraf mishe?

    lotfan rahnameee konid.

  • It works correctly using the latest build. Here's the picture

  • Abbas Zolfaghari (gravatar)

    Abbas Zolfaghari said
    August 16, 2010

    Salam Aghaye Eskandari

    Mamnoon az Control haye khoobi ke neveshtid.

    control FADatePickerConverter tooye win7 set date timesh dorost kar nemikone.

    man ghabl az in ke form baz beshe oono set mikonam, ama set nemishe va 1/1/1 ro miare.

    dar zemn culture oon ro ham too load project set mikonam.

                    Thread.CurrentThread.CurrentCulture = new CultureInfo("fa-IR");
                    Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

    Lotfan rahnamayee befarmaeed.

    pisha pish az vaghti ke migozarid mamnoonam.
     

  • Abbas Zolfaghari (gravatar)

    Abbas Zolfaghari said
    August 16, 2010

    سلام هادی عزیز

    لازم می دانم از خدمت بزرگی که برای همه ایرانیان کرده اید از شما تشکر کنم.

    ببخشید وقتی پست قبلی رو نوشتم  آخرین نسخه برنامه رو نداشتم ولی الان اونو گرفتم و تستش کردم. اما هرچی گشتم کنترل 

    FADatePickerConverter

    رو که من بطور گسترده ای توی برنامه ام استفاده کرده ام ندیدم.

    این کنترل امکان دیدن تاریخ میلادی و شمسی رو با زدن کلید کانورت باتن که داخل خود کنترل تعبیه کرده بودید می داد (عالی بود) و هیچ مشکلی نداشت تا اینکه برنامه رو توی ویندوز 7 سون که نصب کردیم تاریخ رو در لود اولیه فرم درست ست نمی کرد (یعنی 1/1/1 می گذاشت) و یک ایراد کوچولوی دیگه هم داشت که وقتی کانورت باتن رو می زدیم تمامی کنترل های هم نوع دیگه برنامه هم  کالچرشون مثل این کنترل میشد که به هر حال کار می کرد.

    حالا آیا در کنترل های جدید(نسخه جدید) این امکان(تبدیل آنلاین تاریخ میلادی و شمسی به یکدیگر) وجود دارد یا اینکه بوده و من پیدایش نکردم یا روش کار عوض شده است.

    لطفاً من را راهنمایی بفرمایید.

    پیشاپیش از وقتی که می گذارید ممنونم:)

Your Information
Mrs. Gravatar (gravatar)

<-- It's a gravatar