public static bool ShowModal(IWin32Window Owner, string ServerAndPort, string UserName, string StreamName, TextWriter Log, out string NewStreamName) { EnumerateStreamsTask Task = new EnumerateStreamsTask(); string ErrorMessage; ModalTaskResult Result = PerforceModalTask.Execute(Owner, null, ServerAndPort, UserName, Task, "Finding streams", "Finding streams, please wait...", Log, out ErrorMessage); if (Result != ModalTaskResult.Succeeded) { if (!String.IsNullOrEmpty(ErrorMessage)) { MessageBox.Show(Owner, ErrorMessage); } NewStreamName = null; return(false); } SelectStreamWindow SelectStream = new SelectStreamWindow(Task.Streams, StreamName); if (SelectStream.ShowDialog(Owner) == DialogResult.OK) { NewStreamName = SelectStream.SelectedStream; return(true); } else { NewStreamName = null; return(false); } }
private void StreamBrowseBtn_Click(object sender, EventArgs e) { string StreamName = StreamTextBox.Text.Trim(); if (SelectStreamWindow.ShowModal(this, Perforce, StreamName, Log, out StreamName)) { StreamTextBox.Text = StreamName; } }