예제 #1
0
파일: MainFrm.cs 프로젝트: rvvyas/TechBlog
        private void btnCustomActions_Click(object sender, EventArgs e)
        {
            string           actfilename = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\customactions.json";
            frmCustomActions frmca       = new frmCustomActions(actions);

            if (frmca.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                actions = frmca.actions;
                Customactions.write(actfilename, actions);
            }
        }
예제 #2
0
파일: MainFrm.cs 프로젝트: rvvyas/TechBlog
        private void MainFrm_Load(object sender, EventArgs e)
        {
            if (Program.layoutfile != "")
            {
                filename = Program.layoutfile;
                loadlayoutfile();
                if (Program.bsilent)
                {
                    btnmsi_Click(null, null);
                    Close();
                }
            }

            string afilename = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\customactions.json";

            if (!File.Exists(afilename))
            {
                File.WriteAllText(afilename, Resource1.customactions1);
            }
            actions = Customactions.read(afilename);
        }
예제 #3
0
파일: MainFrm.cs 프로젝트: rvvyas/TechBlog
        private void btnaction_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNodes.Count == 0)
            {
                return;
            }
            Nodedata data = (Nodedata)(treeView1.SelectedNodes[0].Tag);
            Dictionary <string, Customaction> customactions = (sender == btnInstall) ? data.inscustomactions : data.uinscustomactions;
            frmSetActions frm = new frmSetActions(Customactions.GetAllActions((sender == btnInstall), actions, data.physicalpath), customactions, (data.physicalpath.Length != 0));

            frm.ShowDialog();
            string sel = "";

            foreach (var a in data.inscustomactions)
            {
                sel = sel + ((sel == "") ? "" : ",") + a.Value.name;
            }
            foreach (var a in data.uinscustomactions)
            {
                sel = sel + ((sel == "") ? "" : ",") + a.Value.name;
            }
            txtactions.Text = sel;
        }