Ejemplo n.º 1
0
        private void TrayIconDoubleClick()
        {
            if (trayIcon.Text.IndexOf("Ввод цифр", StringComparison.OrdinalIgnoreCase) != -1)
            {
                if (m_fc != null)
                {
                    return;
                }

                m_fc          = new FormCode();
                m_fc.Location =
                    new Point(
                        Screen.PrimaryScreen.WorkingArea.Width - m_fc.Width - 5,
                        Screen.PrimaryScreen.WorkingArea.Height - m_fc.Height - 5);
                m_fc.ShowDialog();
                var dr = m_fc.DialogResult;
                AppVars.GuamodCode = m_fc.Code;
                m_fc.Dispose();
                m_fc = null;
                if (dr == DialogResult.OK)
                {
                    if (string.IsNullOrEmpty(AppVars.FightLink))
                    {
                        AppVars.FightLink = "????";
                    }
                    else
                    {
                        AppVars.Autoboi = AutoboiState.AutoboiOn;
                    }

                    AppVars.FightLink = AppVars.FightLink.Replace("????", AppVars.GuamodCode);

                    timerTray.Stop();
                    trayIcon.Text = AppVars.Profile.UserNick;
                    TrayShowFrame(0);
                }

                if (dr != DialogResult.Yes)
                {
                    return;
                }
            }

            timerTray.Stop();

            Show();
            WindowState      = _prevWindowState;
            trayIcon.Visible = false;
        }
Ejemplo n.º 2
0
        private void executeJavaScriptToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var codeForm = new FormCode();

            if (codeForm.ShowDialog(this) == DialogResult.OK)
            {
                var node = (MyNode)treeWidgets.SelectedNode.Tag;
                var json = LastProcess.ExecCommand(new {
                    cmd  = "execJs",
                    ptr  = node.Ptr,
                    code = codeForm.Code,
                });
                var data = json.TryGet <string>("data");
                if (!string.IsNullOrEmpty(data))
                {
                    Clipboard.SetText(data);
                }
                //MessageBox.Show(this, "Result has been copied to your clipboard.", "QtSpy");
            }
        }