public static void DoShowDialog()
 {
     if (_instance != null)
     {
         _instance.BringToFront();
         return;
     }
     else
     {
         _instance = new FindDialog();
         _instance.ShowDialogInternal();
     }
 }
        void ShowDialogInternal()
        {
            TreeNode node = GetFirstSelectedNode();

            if (node == null)
            {
                Hide();
                _instance = null;
                ErrorDialog.Show(StringParser.Parse("${res:ComponentInspector.FindDialog.NoTreeNodeSelectedMessage}"),
                                 StringParser.Parse("${res:ComponentInspector.FindDialog.NoTreeNodeSelectedDialogTitle}"),
                                 MessageBoxIcon.Error);
                return;
            }

            _startingNode.Text = node.FullPath;
            _startingNode.Tag  = node;

            SetButtons(false);
            Show();
        }
 protected override void OnClosed(EventArgs e)
 {
     _instance = null;
     base.OnClosed(e);
     Dispose();
 }