Posts Categorized: Miscellaneous

How to determine light or dark theme in WP7

Posted by & filed under .Net, CodeProject, Miscellaneous, Windows Phone.

WP7 supports light theme and dark theme, you should consider the theme, while developing the apps, otherwise there is chance that you may fail the certification. You can query the resource PhoneLightThemeVisibility, which will be true, if Phone theme is light to determine the theme. Or you can use XAML Databinding also to display / [...]

How to lock system using C#

Posted by & filed under .Net, CodeProject, Miscellaneous, Win 32 API.

Another WIN32 API tip helps to lock your system from C# code. It is very straight forward API. You can find this more information about LockWorkStation function from MSDN. Here is the WIN32 API declaration. And here is the implementation. Happy Coding

How to uninstall Internet Explorer 9

Posted by & filed under Miscellaneous, Windows 7.

Due to some VPN connectivity issues, today I had to rollback my IE installation, and I couldn’t find it in the control panel, Add or remove programs. I deselected the check box in Windows Programs and Features dialog, but it removed the Internet explorer from my computer. Later I found the solution in Microsoft website. [...]

How to return value based on condition in Moq

Posted by & filed under .Net, .Net 4.0, Miscellaneous, Unit Testing.

Today I while writing unit test for one class I got a problem, I have factory method, which will return values based on the input given, and I want to mock this method. I was using Moq for mocking. And I found a solution like this. Happy Programming

Extract to User Control feature in Visual Studio 2012

Posted by & filed under ASP.Net, Miscellaneous, Visual Studio.

The Visual Studio 2012 comes with a nice feature allows web developers to refactor aspx markup into user controls, called Extract to User Control, this feature is available in context menu. To use this feature, simply highlight the bits and pieces to extract and then right-click and click Extract to User Control. Which will display [...]