Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <string> bindings;

            if (validate())
            {
                IBMi.setConfig("CLBind", string.Join("|", generateCommands()));
                bindings = IBMi.getConfig("binds").Split('|').ToList();
                bindings.Add("CLBind");
                IBMi.setConfig("binds", string.Join("|", bindings.ToArray()));

                if (Main.bindsWindow != null)
                {
                    Main.bindsWindow.cmdBindings_Load();
                    Win32.SendMessage(PluginBase.nppData._nppHandle, NppMsg.NPPM_DMMSHOW, 0, Main.bindsWindow.Handle);
                }

                this.Close();
            }
        }
Example #2
0
        private void treeView1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                if (treeView1.SelectedNode != null)
                {
                    var confirmResult = MessageBox.Show("Are you sure to delete this binding?",
                                                        "Delete binding",
                                                        MessageBoxButtons.YesNo);

                    if (confirmResult == DialogResult.Yes)
                    {
                        bindings.Remove(treeView1.SelectedNode.Text);
                        IBMi.setConfig("binds", string.Join("|", bindings.ToArray()));
                        IBMi.remConfig(treeView1.SelectedNode.Text);
                        treeView1.Nodes.Remove(treeView1.SelectedNode);
                    }
                }
            }
        }
Example #3
0
        public void wrkWithBind()
        {
            TreeNode curNode;

            editingCanceled = true;
            new wrkBind().ShowDialog();
            if (editingCanceled == false)
            {
                IBMi.setConfig(editingBind, string.Join("|", editingBindCmds));

                if (bindings.Contains(editingBind))
                {
                    //Handled in wrkwithBind
                }
                else
                {
                    curNode     = treeView1.Nodes.Add(editingBind);
                    curNode.Tag = string.Join("|", editingBindCmds);

                    bindings.Add(editingBind);
                    IBMi.setConfig("binds", string.Join("|", bindings.ToArray()));
                }
            }
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() == "")
            {
                textBox1.Focus();
                return;
            }
            if (textBox2.Text.Trim() == "")
            {
                textBox2.Focus();
                return;
            }
            if (textBox3.Text.Trim() == "")
            {
                textBox3.Focus();
                return;
            }

            IBMi.setConfig("system", textBox1.Text);
            IBMi.setConfig("username", textBox2.Text);
            IBMi.setConfig("password", textBox3.Text);

            this.Close();
        }