Category: "Example Codes"
I have completed the users section for AdvGenCMS. I used ASP.Net MVC 3 and Razor to do. It has CRUD functions and used the LINQ Repository Pattern. I think that is a good example for MVC3 in C#.
Please download the source and check it out http://localhost:44271/Account/List page in your own development box.
Custom Membership Provider is easy to do. Firstly, please extends MembershipProvider
Secondly, Right Click MembershipProvider, and then implements all abstract methods.
The only method you need to change:
Lastly, chaging web.config
Please download our opensource project, AdvGenCMS, as the example.
In Windows Form time, there is a component for Timer. But in WPF, there is not such things. So, what thing we can do, when we need to execute a piece of code periodically. We can use the timers under System.Timers. But please do not use System.Timers.Timer, because it triggered, it will execute the code in a new thread. If you try to access any controls in WPF Windows, the system will throw an exception. I like to use System.Windows.Threading.DispatcherTimer in WPF, because that is very similar with the Timer in Windows Timer.
There are the example code:
To find more about this, please download the example project, AdvGenStopWatch.
I created an opensource project, AdvGenStopWatch. This is a simple stop watch program and aimed to show how to use WPF. Including the following features:
- How to use Grid Layout and ViewPoint, this make all elements will be autosize.
- How to use Timer in WPF
- How to use ListView
I believe this is a good starting point to learn WPF.
I thought that is impossible to put your PC in sleep or hibernate via C#. I found that is incorrect! Moreover, that is very simple too, just one line of command.
Putting the PC in sleep mode
Putting the PC in Hibernate mode
That is so simple!!!