예제 #1
0
        private void IsdalMainEdit_Click(object sender, System.EventArgs e)
        {
            // CombHkey || 0 = LocalMachine 1 = CurrentUser

            int TheRootIndex = 0, TheTypeIndex = 0;

            if (ViewMain.FocusedItem.SubItems[2].Text == "HKEY_CURRENT_USER")
            {
                TheRootIndex = 1;
            }

            switch (ViewMain.FocusedItem.SubItems[3].Text)
            {
            case "Run":     //Run
                TheTypeIndex = 0;
                break;

            case "RunOnce":     // RunOnce
                TheTypeIndex = 1;
                break;

            case "RunOnceEx":     // RunOnceEx
                TheTypeIndex = 2;
                break;

            case "RunServices":     // RunServices
                TheTypeIndex = 3;
                break;

            case "RunServicesOnce":     // RunServicesOnce
                TheTypeIndex = 4;
                break;
            }

            MyEd = new FrmEditAddEntries();

            MyEd.CombHkey.SelectedIndex   = TheRootIndex;
            MyEd.CombSuffix.SelectedIndex = TheTypeIndex;
            //MyEd.CombSuffix.Enabled = false;

            MyEd.TxtCommandAddEdit.Text = ViewMain.FocusedItem.SubItems[1].Text;
            MyEd.TxtNameAddEdit.Text    = ViewMain.FocusedItem.Text;

            MyEd.Text = " Edit " + ViewMain.FocusedItem.Text;

            MyEd.pictureBox1.Image = this.ViewMain.LargeImageList.Images[ViewMain.FocusedItem.ImageIndex];

            MyEd.Cmd_Test.DialogResult = DialogResult.Yes; // Send a Yes So We could know it is edit

            if (MyEd.ShowDialog(this) == DialogResult.Yes) // this to refresh the view when necessary
            {
                ContainerMathod(TreeMain.SelectedNode.FullPath);
            }
        }
예제 #2
0
        private void IsdalMainAdd_Click(object sender, System.EventArgs e)
        {
            MyEd = new FrmEditAddEntries();

            MyEd.CombHkey.SelectedIndex   = 1;
            MyEd.CombSuffix.SelectedIndex = 0;

            MyEd.TxtCommandAddEdit.Text = null;
            MyEd.TxtNameAddEdit.Text    = null;

            MyEd.Cmd_Test.DialogResult = DialogResult.OK; // Send an OK So We could know it is Add

            if (MyEd.ShowDialog(this) == DialogResult.OK)
            {
                // here we should not refer to the currently selected node WHY
                // cause the user might not add in the same spot
                //AND you can track where did he created the entry an focus on it
                ContainerMathod("All Enabled Entries");

                TreeMain.SelectedNode = TreeMain.Nodes[0];
            }
        }