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

namespace Telerik.QuickStart.WinControls
{
    public partial class SupportResourcesToolbar : UserControl
    {
        public SupportResourcesToolbar()
        {
            InitializeComponent();
            this.BackColor = Color.Transparent;
        }

        private void buttonForumsClick( object sender, EventArgs e )
        {
            try
            {
                System.Diagnostics.Process.Start("http://www.telerik.com/community/forums.aspx");
            }
            catch
            {
            }
        }

        private void buttonKBClick( object sender, EventArgs e )
        {
            try
            {
                System.Diagnostics.Process.Start("http://www.telerik.com/support/kb/winforms.aspx");
            }
            catch
            {
            }
        }

        private void buttonDocumentationClick( object sender, EventArgs e )
        {
            try
            {
                System.Diagnostics.Process.Start("http://www.telerik.com/help/winforms");
            }
            catch
            {
            }
        }

        private void buttonMoviesClick( object sender, EventArgs e )
        {
            try
            {
                System.Diagnostics.Process.Start("http://www.telerik.com/support/trainer/winforms.aspx");
            }
            catch
            {
            }
        }

        private void buttonSearchClick( object sender, EventArgs e )
        {
            try
            {
                if (!string.IsNullOrEmpty( this.radTextBox1.Text ))
                {
                    System.Diagnostics.Process.Start("http://www.telerik.com/support/search.aspx?start=0&pf=523&q=" + radTextBox1.Text);
                }
                else
                {
                    System.Diagnostics.Process.Start("http://www.telerik.com/support/winforms.aspx");
                }
            }
            catch
            {
            }
        }

        private void radTextBox1_Click( object sender, EventArgs e )
        {
            if (this.radTextBox1.Text == "Search All Online Resources")
                this.radTextBox1.Text = string.Empty;
        }
    }
}
