IntroductionIn the process of writing software for another project, I was faced with the need to work with calculations of time periods. These calculations were an important part of the solution, so the requirements for correctness and accuracy of the results were high.
The required functionality covered the following areas:
1. Support individual time periods
2. Work with the calendar of periods within the calendar year
3. Work with a calendar of periods beyond the calendar year (fiscal year or school school year)
')
Such calculations should be accessible both for server components (web services and tasks) and for “fat” clients (Silverlight).
An analysis of the situation led me to the conclusion that neither the components of the .NET Framework (which I did not expect) or the other available tools do not meet all my requirements. And since I had already encountered similar problems in previous projects, I decided to develop a library for these purposes.
Several development cycles led to the creation of the Time Period library, which is now available for such execution environments:
1. .NET Framework version 2 and above
2. .NET Framework for Silverlight from version 4
3. .NET Framework for Windows Phone since version 7
In order to demonstrate some of the functionality of the library, I made an application on Silverlight, called it Calendar Period Collector and placed it at
http://www.cpc.itenso.com/ . The application demonstrates the search for calendar periods.
Next, read the translation in the blog (a lot of code, it is not possible to transfer it to Habr quality):
Read further .
The article was the best C # article on CodeProject in March 2011, and also the best article of CodeProject in March 2011.
Source codes and links :
Source code of the project on CodeProject:
Download code .
Project source code on box.com:
Download code .
Link to original article:
by Jani Giannoudis .
Kindly requestedBefore minus the note, without reading the article, make an effort - look at least at the amount of work done. And if your minus is a consequence of the fact that the article is not fully published on Habré and you are ready to assist with high-quality code transfer, I’m glad to accept your help and post it here completely.