private void OkBtn_Click(object sender, EventArgs e) { AutomatedSyncWindow.WorkspaceInfo SelectedWorkspaceInfo; if (AutomatedSyncWindow.ValidateWorkspace(this, Perforce, WorkspaceNameTextBox.Text, StreamName, Log, out SelectedWorkspaceInfo)) { Result = new BuildInfo(); Result.SelectedWorkspaceInfo = SelectedWorkspaceInfo; Result.ProjectPath = WorkspacePathTextBox.Text; Result.bSync = SyncToChangeCheckBox.Checked; Result.ExecCommand = ExecCommandTextBox.Text; DialogResult = DialogResult.OK; Close(); } }
public static bool ShowModal(IWin32Window Owner, PerforceConnection DefaultConnection, string StreamName, string ProjectPath, int Changelist, string Command, UserSettings Settings, TextWriter Log, out BuildInfo BuildInfo) { string DefaultWorkspaceName = AutomatedSyncWindow.FindDefaultWorkspace(Owner, DefaultConnection, StreamName, Log); string DefaultProjectPath = null; if (!String.IsNullOrEmpty(ProjectPath)) { DefaultProjectPath = ProjectPath; } else if (DefaultWorkspaceName != null) { string ClientPrefix = String.Format("//{0}/", DefaultWorkspaceName); foreach (UserSelectedProjectSettings ProjectSettings in Settings.RecentProjects) { if (ProjectSettings.ClientPath.StartsWith(ClientPrefix, StringComparison.OrdinalIgnoreCase)) { DefaultProjectPath = ProjectSettings.ClientPath.Substring(ClientPrefix.Length - 1); break; } } } AutomatedBuildWindow Window = new AutomatedBuildWindow(StreamName, Changelist, Command, DefaultConnection, DefaultWorkspaceName, DefaultProjectPath, Log); if (Window.ShowDialog() == DialogResult.OK) { BuildInfo = Window.Result; return(true); } else { BuildInfo = null; return(false); } }