Ejemplo n.º 1
0
        private void SetHandlers()
        {
            if (this.window != null)
            {
                this.Text = this.window.Text;

                this.ContextMenuStrip = this.window.ContextMenuStrip != null ? this.window.ContextMenuStrip : new ContextMenuStrip();
                ToolStripMenuItem item = new ToolStripMenuItem(Resources.Close, null, delegate(object o, EventArgs e) { this.window.Close(); });
                item.ToolTipText = Resources.CloseToolTip;
                this.ContextMenuStrip.Items.Add(item);

                this.window.TextChanged += (sender, e) =>
                {
                    this.Text = this.window.Text;
                };
                this.window.Activated += (sender, e) =>
                {
                    if (this.TreeView != null && this.TreeView.SelectedNode != this && !MDIParent.BlockActivation)
                    {
                        this.TreeView.SelectedNode = this;
                    }
                };
                this.window.Disposed += (sender, e) =>
                {
                    if (!this.Sticked)
                    {
                        try
                        {
                            Remove();
                            Dispose();
                        }
                        catch (Exception) { }
                    }
                    else
                    {
                        this.window = null;
                        if (this.IsSelected)
                        {
                            this.TreeView.SelectedNode = null;
                        }
                    }
                };
            }
        }
Ejemplo n.º 2
0
 public WindowNode(IRCForm window, string text, int image)
     : base(text, image, image)
 {
     this.window = window;
     SetHandlers();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Создание узла
 /// </summary>
 /// <param name="form"></param>
 /// <param name="text"></param>
 public WindowNode(IRCForm window, string text)
     : base(text)
 {
     this.window = window;
     SetHandlers();
 }