private void button1_Click(object sender, EventArgs e) { Boolean isValid = true; switch (tabs.SelectedIndex) { case 0: if (!IBMiUtils.IsValueObjectName(lib.Text)) { isValid = false; } if (!IBMiUtils.IsValueObjectName(spf.Text)) { isValid = false; } if (!IBMiUtils.IsValueObjectName(mbr.Text)) { isValid = false; } if (isValid) { Editor.OpenSource(new RemoteSource("", lib.Text, spf.Text, mbr.Text, type.Text, true)); Library = lib.Text; SPF = spf.Text; this.Close(); } else { MessageBox.Show("Member information not valid."); } break; case 1: stmfPath.Text = stmfPath.Text.Trim(); if (IBMi.FileExists(stmfPath.Text)) { Editor.OpenSource(new RemoteSource("", stmfPath.Text)); Stmf = stmfPath.Text; this.Close(); } else { MessageBox.Show("Chosen file does not exist."); } break; } }
private void open_Click(object sender, EventArgs e) { stmfPath.Text = stmfPath.Text.Trim(); if (stmfPath.Text == "") { MessageBox.Show("Path cannot be blank"); } else { if (!IBMi.FileExists(stmfPath.Text)) { string filetemp = Path.Combine(IBMiUtils.GetLocalDir("IFS"), Path.GetFileName(stmfPath.Text)); File.Create(filetemp).Close(); result = new RemoteSource(filetemp, stmfPath.Text); this.Close(); } else { MessageBox.Show("Chosen path already exists."); } } }