Code contracts (Part 1): Introduction

During developing applications we have always use unwritten rule in programming or if it is written in design documents user should consider them in development. For example if developer wants to call a method which has an integer parameter and this parameter is used as an index of array he should be aware calling that method with negative value or greater than array lenght. Calling method with negative value causes runtime error. There are lots of contracts that a developer should consider during development. Recently I came across new concept (However it is in research phase) named CodeContracts which is... [Read More]

Simple theme for Graffiti CMS

Graffiti CMS express edition is popular amid developers as well as Community Server. At the moment I wanted to decide between Graffiti And Community Server  I couldn't made my mind. Blog subsystem of community server has a simple theme which is similar to MSDN blog theme (Like current theme). This theme was inducement of community server. Finally, I used graffiti because of simplicity, anyway , Recently I decided to convert simple theme of community server 2008 to graffiti CMS theme. I put first version of simple theme [here](https://gkasoq.bay.livefilestore.com/y1pkcDCK8ftzzfzO_6UO7nvtklXqCwp8FPSD2Tp_Lj3_7WVvfN_YWXQX5DBuXKoWFPiX8yUuyvqx96dLHR7MiWKIw/Simple.zip?download&psid=1) [Read More]
Tags: Graffiti CMS

Where are the Northwind and Pubs?

SQL Server 2005 is installed without any samples - at least versions I installed don’t contain Northwind and pubs databases -. However Microsoft put SQL Server 2005 Samples and Sample Databases in Codeplex, light version of these two sample databases were always famous in a way that you can find one of them in most database related samples with high probability.  You can find SQL Server 2000 Sample here. After installation file is downloaded take following two steps: 1. Install msi file. Some files will be copied in C:\SQL Server 2000 Sample Databases 2. Attach Northwind.mdf file which is located... [Read More]

How to change mouse cursor icon in windows mobile application

Informing user about application state is one of important aspects in user experience. In windows applications mouse icon indicates one of great application states. When an application is busy mouse icon should be changed to wait cursor mode or hourglass icon. In windows application you can achieve this by changing Cursor property of any Control, Usually by changing "this.Cursor" which "this" is current form in application. See example: [Read More]

TickCount instead of millisecond in compact framework

After long absence I'm back now. Recently I wanted to develop an application for windows mobile with .Net Compact framework. In this application I need to measure elapsed time in millisecond resolution. First of all like everyone I tried to use Millisecond property of DateTime.Now static class. But it won't work at all in .Net Compact framework even in version 3.5! If you want to use a timer with millisecond resolution you have to use TickCount property of Environment class. //Will be zero. lblMillisecondVal.Text = DateTime.Now.Millisecond.ToString(); //Total milliseconds elapsed since the system started. lblTickCountVal.Text = Environment.TickCount.ToString(); [Here](https://gkasoq.bay.livefilestore.com/y1p-j36TiPUqAUB6w5kYE05nlr4sJQ6zrqwpr1ggB654bL0E7JHIehasbHjEaireeiTg9vR_nxCaAskngmyKX-o1Q/TickCountTest.zip?download&psid=1) is an example... [Read More]