private void OpenMember(string Lib, string Obj, string Mbr, Boolean Editing) { Thread gothread = new Thread((ThreadStart) delegate { string resultFile = IBMiUtilities.DownloadMember(Lib, Obj, Mbr); if (Main.CommandWindow != null) { Main.CommandWindow.loadNewOutput(); } if (resultFile != "") { NppFunctions.OpenFile(resultFile, !Editing); if (Editing) { OpenMembers.AddMember(IBMi.GetConfig("system"), resultFile, Lib, Obj, Mbr); } } else { MessageBox.Show("Unable to download member " + Lib + "/" + Obj + "." + Mbr + ". Please check it exists and that you have access to the remote system."); } }); gothread.Start(); }
private void button1_Click(object sender, EventArgs e) { this.isReadonly = checkBox1.Checked; textBox1.Text = textBox1.Text.ToUpper(); textBox2.Text = textBox2.Text.ToUpper(); textBox3.Text = textBox3.Text.ToUpper(); if (!IBMiUtilities.IsValidQSYSObjectName(textBox1.Text)) { MessageBox.Show("Library name is not valid."); return; } if (!IBMiUtilities.IsValidQSYSObjectName(textBox2.Text)) { MessageBox.Show("Object name is not valid."); return; } if (!IBMiUtilities.IsValidQSYSObjectName(textBox3.Text)) { MessageBox.Show("Member name is not valid."); return; } string resultFile = IBMiUtilities.DownloadMember(textBox1.Text, textBox2.Text, textBox3.Text); if (Main.CommandWindow != null) { Main.CommandWindow.loadNewOutput(); } if (resultFile != "") { //Open File NppFunctions.OpenFile(resultFile, this.isReadonly); OpenMembers.AddMember(textBox4.Text, resultFile, textBox1.Text, textBox2.Text, textBox3.Text, !this.isReadonly); this.Close(); } else { MessageBox.Show("Unable to download member " + textBox1.Text + "/" + textBox2.Text + "." + textBox3.Text + ". Please check it exists and that you have access to the remote system."); } }