Skip to main content

Posts

Showing posts from April, 2011

Discover Click Once Applications Currently Installed

To discover “Click Once” applications currently installed in a machine, below code helps to find out currently installed click once applications. The GetInstalledClickOnceApps() method read the installed click once applications from Registry;add it to the list and return the list. The LoadInstalledClickOnceApps() method binds installed application names and version to the list view. The Load() method is the root method. Code: public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();             Load();         }         ///         /// Load         ///    ...

C# Custom Exceptions Design

The below are the few design rules for creatng custom exceptions. 1. Derive exceptions from System.Exception or one of the other common base exceptions. As per "Catching and Throwing Standard Exception Types" guidelines you should not derive custom exceptions from "ApplicationException". 2. End exception class names with "Exception" suffix. Just follow consistent naming conventions. 3. Make exceptions serializable. An exception must be serializable to work correctly across application domain and remoting boundaries. 4. Provide at least the common constructors on all exceptions. 5. Try to avoid deep exception hierarchies. Custom exceptions greatly improve and simplify the error handling and also increase the overall code quality. The first step is to create the class for your custom exception that inherits from the base exception class. Here we have created "ZipCodeNotFoundException" class. ZipCodeNotFoundException.cs: using System...

Introduction to SOA

SOA (Service Oriented Architecture) is a much discussed architectural model for developing loosely coupled distributed systems. If one asks two people to define SOA one is likely to receive two very different, possibly conflicting, answers. Some describe SOA as an IT infrastructure for business enablement while others look to SOA for increasing the efficiency of IT. SOA (Service Oriented Architecture) is a much discussed architectural model for developing loosely coupled distributed systems. If one asks two people to define SOA one is likely to receive two very different, possibly conflicting, answers. Some describe SOA as an IT infrastructure for business enablement while others look to SOA for increasing the efficiency of IT. While exactly what defines an SOA is still debated, there is general agreement that it is fundamentally an architectural pattern based on interoperable Services that communicate using messages. Simple Definition:   A loosely-coupled architecture designed to ...