public SGUserControl_AddAndEditRunCommands(string type, SGForm_Function_SystemStyle f, string subname = "", int select = 0) { InitializeComponent(); this.DrawSkin(); ty = type; ff = f; this.subname = subname; this.sleectindex = select; if (type == "edit") { string loc = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"; sgTextBox1.Text = subname.Substring(0, subname.LastIndexOf(".")); string cmd = SGFunction.RegistryOperate.RegistryOperate_ValueOperate("get", Microsoft.Win32.Registry.LocalMachine, loc + "\\" + subname, "", ""); string ext = SGFunction.FileSystemOperate.FileSystemOperate_GetFileExtraName(cmd).ToLower(); string arg = ""; if (ext == "lnk") { string lbkf = cmd; //是LNK文件 cmd = SGFunction.SystemFunctionAndInformation.ReadLink(cmd, "path"); arg = SGFunction.SystemFunctionAndInformation.ReadLink(lbkf, "Args"); islink = true; shelllink = lbkf; } sgTextBox3.Text = arg; sgTextBox2.Text = cmd; sgTextBox1.Enabled = false; //sgCheckBox1.Checked = false; //sgCheckBox1.Visible = false; } }
public UserControl_ChooseThemes(SGForm_Function_SystemStyle sgfrm, SystemGear.窗体.SGForm_Main mainfrm) { InitializeComponent(); this.loadinstalledskins(); this.sgfrm = sgfrm; this.mainfrm = mainfrm; this.DrawSkin(); }
/// <summary> /// 运行主界面的SubCommand 当命令为SG|INDEX 会返回BOOL 其余返回命令执行结果 /// </summary> /// <param name="tag">自定的命令的节</param> /// <param name="m">主窗体</param> /// <param name="ss">系统外观设置</param> /// <param name="shelltype">输出执行命令的模式 [NORMAL] 正常命令或执行失败的命令 [SGF] SG|INDEX 返回BOOL 用于窗体隐藏</param> public static bool ShellSubCommand_Command(object tag, SGForm_Main m, SGForm_Function_SystemStyle ss, out string shelltype) { try { if (tag == null) { shelltype = "NORMAL"; return(false); } string ret_t = "NORMAL"; bool ret_res = false; string cfg = SGFunction.SpecialFoldersOrFile.GetSystemGearSpecialFolderOrFile("config") + "\\SGSubCommands.sgcf"; string read = SGFunction.ConfigFileOperate.SGCFFileOperate_GetValue(tag.ToString(), "command", "", cfg, false); bool res = SGFunction.RunCommand.ShellCommand(read); if (res == false) { //看看是不是SG|INDEX string[] pp = read.Split('|'); if (pp != null) { if (pp.Length == 2) { //也许是 if (pp[0].ToUpper() == "SG") { //50%是 string cmd = pp[1]; bool p = SGFunction.RunCommand.ShellSGFunction(m, ss, cmd, out m.sgstyfrm); ret_res = p; ret_t = "SGF"; } else { ret_res = false; ret_t = "SGF"; } } else { ret_res = false; ret_t = "NORMAL"; } } else { ret_res = false; ret_t = "NORMAL"; } } else { ret_t = "NORMAL"; ret_res = true; } shelltype = ret_t; return(ret_res); } catch { shelltype = "NORMAL"; return(false); } }
public SGUserControl_CreateRightMenu(string ty, string code, SGForm_Function_SystemStyle f, string[] tags, int se = 0) { InitializeComponent(); //SKINS SGFunction.Skins.DrawAllControlInUserControl(this, SGFunction.Skins.Skins_GetControlColorSetting("DIALOG_STANDARD", "BK")); this.panel1.BackColor = SGFunction.Skins.Skins_GetMainColorSetting("maincolor", "light"); MyNormalButton2.BackColor = SGFunction.Skins.Skins_GetControlColorSetting("BTN_OTHER", "BK"); MyNormalButton2.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("BTN_OTHER", "fr"); //CODE type = ty; this.code = code; ff = f; select = se; this.tags = tags; switch (ty) { case "edit": this.LoadMenu(); bool h = this.GetMenuType_IsSystem(); sgTextBox2.Size = new Size(358, 23); sgTextBox_arg.Visible = false; sgTextBox_arg.Text = ""; if (h) { panel1.BackColor = warr; pictureBox1.Visible = sgLabel1.Visible = true; pictureBox1.BackColor = warr; } break; case "create": sgTextBox2.Size = new Size(358, 23); sgTextBox_arg.Visible = false; sgTextBox_arg.Text = ""; break; case "edit_sendto": sgTextBox2.Size = new Size(247, 23); sgTextBox_arg.Visible = true; this.LoadSendToMenu(tags[0], tags[1]); //0是LNK 1是名称 break; case "create_sendto": sgTextBox2.Size = new Size(247, 23); sgTextBox_arg.Visible = true; break; case "create_selectext": sgTextBox2.Size = new Size(358, 23); sgTextBox_arg.Visible = false; sgTextBox_arg.Text = ""; ext = code; //.exe //MessageBox.Show(ext); break; } }
public SGUserControl_AddAndEditWinXMenu(string ty, string gr, string lnkn, SGForm_Function_SystemStyle S, string name = "") { InitializeComponent(); SGFunction.Skins.DrawAllControlInUserControl(this, SGFunction.Skins.Skins_GetControlColorSetting("DIALOG_STANDARD", "BK")); this.type = ty; this.ff = S; this.gr = gr; this.lnkn = lnkn; if (ty == "edit") { //MessageBox.Show(name); sgTextBox1.Text = name; string cmd = SGFunction.SystemFunctionAndInformation.ReadLink(lnkn, "path"); string arg = SGFunction.SystemFunctionAndInformation.ReadLink(lnkn, "args"); sgTextBox2.Text = cmd; sgTextBox3.Text = arg; sgCheckBox1.Visible = false; sgCheckBox1.Checked = false; } }
public SGUserControl_CLSIDMGR(string type, string cfg, SGForm_Function_SystemStyle s, int seleindex = 0, string[] editinfo = null) { InitializeComponent(); //SKIN SGFunction.Skins.DrawAllControlInTabControl(this.sgTabPageControl1); //this.panel1.BackColor = SGFunction.Skins.Skins_GetMainColorSetting("maincolor", "light"); MyNormalButton2.BackColor = SGFunction.Skins.Skins_GetControlColorSetting("BTN_OTHER", "BK"); MyNormalButton2.ForeColor = SGFunction.Skins.Skins_GetControlColorSetting("BTN_OTHER", "fr"); this.panel1.BackColor = SGFunction.Skins.Skins_GetMainColorSetting("maincolor", "light"); //CODE this.type = type; ss = s; selecindex = seleindex; sgTabPageControl1.Location = new Point(-4, -39); this.cfg = cfg; switch (type.ToUpper()) { case "CREATE_MENU": sgTabPageControl1.SelectedIndex = 0; break; case "EDIT": sgTabPageControl1.SelectedIndex = 0; if (editinfo != null) { if (editinfo.Length > 0) { keyname = editinfo[0]; } } this.Load_EditCLSIDMenu(editinfo); break; case "EDITMAIN": sgTabPageControl1.SelectedIndex = 1; this.Load_EditCLSIDMainMenu(editinfo); break; } }