Beispiel #1
0
        } //Clave de Método: Principal-MF

        private void ClickMethod(object sender, EventArgs e)
        {
            for (; Index < ArrayButton.Length; Index++)
            {
                if (ArrayButton[Index] == sender)
                {
                    break;
                }
            }
            switch (Index)
            {
            case 0:     //ButtonUsers
            {
                try
                {
                    MostrarForm(ObjUsers);
                }catch (NullReferenceException)
                {
                    ObjUsers = new Users(ObjSession);
                    MostrarForm(ObjUsers);
                }
                break;
            }

            case 1:     //ButtonMoves
            {
                try
                {
                    MostrarForm(ObjMoves);
                }
                catch (NullReferenceException)
                {
                    ObjMoves = new Moves(ObjSession);
                    MostrarForm(ObjMoves);
                }
                break;
            }

            case 2:     //ButtonStats
            {
                try
                {
                    MostrarForm(ObjStats);
                }
                catch (NullReferenceException)
                {
                    ObjStats = new Stats(ObjSession);
                    MostrarForm(ObjStats);
                }
                break;
            }

            case 3:     //ButtonBinnacle
            {
                break;
            }

            case 4:     //ButtonImportUsers
            {
                try
                {
                    MostrarForm(ObjImports);
                }
                catch (NullReferenceException)
                {
                    ObjImports = new Imports(ObjSession);
                    MostrarForm(ObjImports);
                }
                break;
            }

            case 5:     //ButtonConfiguration
            {
                try
                {
                    MostrarForm(ObjConfiguration);
                }
                catch (NullReferenceException)
                {
                    ObjConfiguration = new Configuration(ObjSession);
                    MostrarForm(ObjConfiguration);
                }
                break;
            }

            case 6:     //ButtonLogOut
            {
                if (ObjLogUser.Visible)
                {
                    ObjLogUser.Hide();
                }
                else
                {
                    ObjLogUser.Show();
                }
                break;
            }

            default:
                throw new Exception("Excepción en Método: Principal-CM", new IndexOutOfRangeException());
            }
            Index = 0;
        } //Clave de Método: Principal-CM