예제 #1
0
        private void InstallApplication()
        {
            BlankForm f = new BlankForm(new ProgramDownloader(Variables.MyLibrarySelected), true)
            {
                Text = "ByteGuard Downloader (BETA - Progress Broken)"
            };

            f.Show();
        }
예제 #2
0
        private void MenuItemRedeem_Click(object sender, EventArgs e)
        {
            BlankForm redeemLicenseForm =
                new BlankForm(new RedeemLicense(Variables.MyLicenses[ListViewLicenses.SelectedItems[0].Index]), true)
            {
                Text = "Redeem License"
            };

            redeemLicenseForm.Show();
        }
예제 #3
0
        private void ButtonActivateAccount_Click(object sender, EventArgs e)
        {
            ButtonActivateAccount.Enabled = false;

            BlankForm f = new BlankForm(new ActivateAccount(), true);

            f.FormClosing +=
                (closedSender, closedE) => ButtonActivateAccount.Enabled = (!Variables.Users.Current.IsActivated);
            f.Show();
        }
예제 #4
0
        private void ButtonAddAdministrator_Click(object sender, EventArgs e)
        {
            ButtonAddAdministrator.Enabled = false;

            BlankForm addAdministratorForm = new BlankForm(new AddAdmin(), true)
            {
                Text = "Add Program Administrator"
            };

            addAdministratorForm.FormClosing += (closedSender, closedE) => ButtonAddAdministrator.Enabled = true;
            addAdministratorForm.Show();
        }
예제 #5
0
        private void ButtonAddVariable_Click(object sender, EventArgs e)
        {
            ButtonAddVariable.Enabled = false;

            BlankForm addVariableForm = new BlankForm(new AddVariable(), true)
            {
                Text = "Add Server Variable"
            };

            addVariableForm.FormClosing += (closedSender, closedE) => ButtonAddVariable.Enabled = true;
            addVariableForm.Show();
        }
예제 #6
0
        private void ButtonCreateLicense_Click(object sender, EventArgs e)
        {
            ButtonCreateLicense.Enabled = false;

            BlankForm createLicenseForm = new BlankForm(new CreateLicense(), true)
            {
                Text = "Create License"
            };

            createLicenseForm.FormClosing += (closedSender, closedE) => ButtonCreateLicense.Enabled = true;
            createLicenseForm.Show();
        }
예제 #7
0
        private void ButtonChangeAvatar_Click(object sender, EventArgs e)
        {
            ButtonChangeAvatar.Enabled = false;

            BlankForm changeAvatarForm = new BlankForm(new ChangeAvatar(), true)
            {
                Text = "ByteGuard - Change Avatar "
            };

            changeAvatarForm.FormClosing += (closedSender, closedE) => ButtonChangeAvatar.Enabled = true;
            changeAvatarForm.Show();
        }
예제 #8
0
        private void LinkLabelViewCreator_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LinkLabelViewCreator.Enabled = false;

            BlankForm viewProfileForm = new BlankForm(new ViewProfile(TextBoxCreator.Text), true)
            {
                Text = "ByteGuard - User profile"
            };

            viewProfileForm.FormClosing += (closedSender, closedE) => LinkLabelViewCreator.Enabled = true;
            viewProfileForm.Show();
        }
예제 #9
0
        private void ButtonViewLockDetails_Click(object sender, EventArgs e)
        {
            ButtonViewLockDetails.Enabled = false;

            Variables.ByteGuardProgram byteguardProgram =
                Variables.MyLibrary[Variables.Forms.Main.MyLibrarySelectedIndex];

            BlankForm f = new BlankForm(new LockDetails(byteguardProgram), true);

            f.FormClosing += (closedSender, closedE) => ButtonViewLockDetails.Enabled = true;
            f.Show();
        }
예제 #10
0
        private void MenuItemModify_Click(object sender, EventArgs e)
        {
            BlankForm f =
                new BlankForm(
                    new ModifyLicense(
                        Variables.MyLicenses.First(
                            l => l.LicenseCode == ListViewLicenses.SelectedItems[0].SubItems[1].Text)), true)
            {
                Text = "Modify License"
            };

            f.Show();
        }
예제 #11
0
        /// <summary>
        /// Displays a blank black window on all screens but the primary screen.
        /// see: http://stackoverflow.com/questions/1363374/showing-a-windows-form-on-a-secondary-monitor
        /// </summary>
        private static void BlankSecondaryScreens()
        {
            foreach (Screen screen in Screen.AllScreens)
            {
                if (screen.Primary == false)
                {
                    System.Drawing.Rectangle bounds = screen.Bounds;
                    Utilities.Log.WriteLine("Secondary screen: " + bounds);

                    Form form = new BlankForm();
                    form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    form.StartPosition   = System.Windows.Forms.FormStartPosition.Manual;
                    form.TopMost         = true;
                    form.SetBounds(-400, -100, 10, 10);
                    form.Show();
                    form.Enabled = false;
                    form.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height);
                    form.WindowState = FormWindowState.Maximized;
                }
            }
        }
예제 #12
0
        private void ButtonLogout_Click(object sender, EventArgs e)
        {
            ButtonLogout.Enabled = false;

            if (Network.SubmitData("logout"))
            {
                Form parentForm  = ParentForm;
                Form currentForm = FindForm();

                BlankForm f = new BlankForm(new Login(false), true);

                if (parentForm != null)
                {
                    f.FormClosed += (closedSender, closedE) => parentForm.Close();
                }

                if (currentForm != null)
                {
                    currentForm.Hide();
                }

                f.Show();
            }
        }