using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace EnterpriseDesktop.Controls
{
    public partial class Navigation : UserControl
    {
        public Navigation()
        {
            InitializeComponent();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Program.Shell.ShowControlInPanel2(new HelpDesk());
            CheckLastClicked(sender as ToolStripButton);
            Program.Shell.HideTreeControls();
            Program.Shell.ShowTreeControl(new HelpDeskTree());
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            Program.Shell.ShowControlInPanel2(new MSN());
            CheckLastClicked(sender as ToolStripButton);
        }

        private void CheckLastClicked(ToolStripButton button)
        {
            foreach (ToolStripItem item in toolStrip1.Items)
            {
                ToolStripButton btn = item as ToolStripButton;
                if (btn != null)
                {
                    btn.Checked = false;
                }
            }
            button.Checked = true;
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            Program.Shell.ShowControlInPanel2(new Home());
            CheckLastClicked(sender as ToolStripButton);
            Program.Shell.HideTreeControls();
            Program.Shell.ShowTreeControl(new HomeTree());
        }
    }
}
