public Add_Command(ConfigService configService, CommandActionConfig commandConfig) { this.configService = configService; this.CommandActionConfig = commandConfig; InitializeComponent(); List<CommandConfig> commands = GetCommands(); cboCommand.DataSource = commands; cboCommand.DisplayMember = "CommandKey"; cboCommand.ValueMember = "CommandUri"; }
private void Edit_Click(object sender, EventArgs e) { CommandActionConfig commandConfig = this.configService.Get <CommandActionConfig>(typeof(CommandActionConfig).FullName, listBox1.SelectedValue as string); Add_Command command = new Add_Command(configService, commandConfig); command.ShowDialog(); if (command.CommandActionConfig != null) { source.ResetCurrentItem(); } }
public Add_Command(ConfigService configService, CommandActionConfig commandConfig) { this.configService = configService; this.CommandActionConfig = commandConfig; InitializeComponent(); List <CommandConfig> commands = GetCommands(); cboCommand.DataSource = commands; cboCommand.DisplayMember = "CommandKey"; cboCommand.ValueMember = "CommandUri"; }
private void button3_Click(object sender, EventArgs e) { CommandActionConfig configService = new CommandActionConfig(); //controllerCreateParam p = new ControllerCreateParam(txtView.Text); //foreach (var viewcommand in viewcommands) //{ // p.Commands.Add(viewcommand); // //configService.Save<CommandParam>(module.Name + "." + p.Name + "." + viewcommand.Name, viewcommand); //} //module.ControllerCreateParams.Add(p.Name, p); // Persist to file /* * FileStream stream = File.Create(ConfigurationSettings.AppSettings["dbPath"] + "\\" + txtModule.Text + "_" + txtView.Text + ".bin"); * BinaryFormatter formatter = new BinaryFormatter(); * formatter.Serialize(stream, module); * stream.Close(); */ }
private void button1_Click(object sender, EventArgs e) { if (txtActionKey.Text == null || txtActionKey.Text == "") { MessageBox.Show("Please provide a unique action key.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (cboCommand.SelectedIndex == -1 || cboCommand.SelectedValue == null) { MessageBox.Show("Please select a command to add.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (rbView.Checked == false && rbJson.Checked == false) { MessageBox.Show("Please select result type.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (rbView.Checked == true && txtViewname.Text == "") { MessageBox.Show("Please give the output view name.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.CommandActionConfig = new CommandActionConfig(); this.CommandActionConfig.ActionKey = txtActionKey.Text; this.CommandActionConfig.CommandConfig = cboCommand.Text; this.CommandActionConfig.ResultType = rbJson.Checked ? "Json" : "PartialView"; if (this.CommandActionConfig.ResultType == "PartialView") { this.CommandActionConfig.ViewName = txtViewname.Text; this.CommandActionConfig.RefreshDiv = txtDivId.Text; } this.configService.Save <CommandActionConfig>(typeof(CommandActionConfig).FullName, this.CommandActionConfig.ActionKey, this.CommandActionConfig); this.FindForm().Close(); }
private void button3_Click(object sender, EventArgs e) { CommandActionConfig configService = new CommandActionConfig(); //controllerCreateParam p = new ControllerCreateParam(txtView.Text); //foreach (var viewcommand in viewcommands) //{ // p.Commands.Add(viewcommand); // //configService.Save<CommandParam>(module.Name + "." + p.Name + "." + viewcommand.Name, viewcommand); //} //module.ControllerCreateParams.Add(p.Name, p); // Persist to file /* FileStream stream = File.Create(ConfigurationSettings.AppSettings["dbPath"] + "\\" + txtModule.Text + "_" + txtView.Text + ".bin"); BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(stream, module); stream.Close(); */ }
private void button1_Click(object sender, EventArgs e) { if (txtActionKey.Text == null || txtActionKey.Text == "") { MessageBox.Show("Please provide a unique action key.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (cboCommand.SelectedIndex == -1 || cboCommand.SelectedValue == null) { MessageBox.Show("Please select a command to add.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (rbView.Checked == false && rbJson.Checked == false) { MessageBox.Show("Please select result type.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (rbView.Checked == true && txtViewname.Text == "") { MessageBox.Show("Please give the output view name.", "Add Command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.CommandActionConfig = new CommandActionConfig(); this.CommandActionConfig.ActionKey = txtActionKey.Text; this.CommandActionConfig.CommandConfig = cboCommand.Text; this.CommandActionConfig.ResultType = rbJson.Checked ? "Json" : "PartialView"; if (this.CommandActionConfig.ResultType == "PartialView") { this.CommandActionConfig.ViewName = txtViewname.Text; this.CommandActionConfig.RefreshDiv = txtDivId.Text; } this.configService.Save<CommandActionConfig>(typeof(CommandActionConfig).FullName, this.CommandActionConfig.ActionKey, this.CommandActionConfig); this.FindForm().Close(); }