A common requirements in most of software's is to generate an hierarchical chart for example organization chart. Rotem Sapir written a DLL to make the task easier and it was published in codeproject. Rotem demonstrated the way of generating tree with text. I have modified his DLL so that we can display both picture and text so that the diagram representation becomes more appealing. Now it will generate chart like following one:
You can get updated component from here. For details of how it works please read Rotem's article from codeproject.
Mutex is a windows kernel level object typically used for thread synchronization across AppDomain and Process boundaries. We can easily use Mutex to confirm that only one instance of our application will run at a time. Following code snippet shows the way of achieving the goal: using System; using System.Windows.Forms; using System.Threading;
namespace SingleInstanceApp { static classProgram { /// /// The main entry point for the application. /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Mutex objMutex = null; const string MutexName = "THEONE"; try { //Open Mutex if already exists objMutex = Mutex.OpenExisting(MutexName); } catch (WaitHandleCannotBeOpenedException) { //Cannot be opened because no Mutex exists } if (objMutex == null) { //Create a new instance of Mutex objMutex = new Mutex(true, MutexName); } else { //Close Mutex because one instance already exists objMutex.Close(); return; } Application.Run(new MainForm()); } } }
Hi, This is Md. Saiful Islam. I am from Dhaka, Bangladesh.I am a passionate .Net developer about 5 years of development experience. Currently, I am working for a Software Development Company called CACTS Limited as a Sr. Software Engineer(Team Lead) for web and desktop applications. I am a 820 point Participant of http://forums.asp.net/.
An Ops Checklist
-
A couple of years back, I spent two months reading through over two
thousand outage incidents from our incident database: what caused it, how
people identi...