partial void ButtonComputerNameEditor_Action(Id sender) { string computers = RmComputerPicker.Show(this.View.Window, new RmComputerPickerArguments() { BonjourEnabled = false, CustomEntryEnabled = this.EditMode == ObjectEditMode.EditMode_New, CanAddMultiple = this.EditMode == ObjectEditMode.EditMode_New, CurrentHosts = textFieldComputerName.StringValue }); if (!string.IsNullOrWhiteSpace(computers)) { string[] computerLines = computers.Split(new string[] { "\r\n", "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries); if (computerLines.Length == 1) { RoyalRDSConnection con = new RoyalRDSConnection(null); ApiUtils.ExtendConnectionWithTaggedComputerString(con, computerLines[0]); if (!string.IsNullOrWhiteSpace(con.Name)) { textFieldDisplayName.StringValue = con.Name; } if (!string.IsNullOrWhiteSpace(con.Description)) { textFieldConnectionDescription.StringValue = con.Description; } if (!string.IsNullOrWhiteSpace(con.URI)) { textFieldComputerName.StringValue = con.URI; CheckIfIsInBulkAddMode(); } } else if (computerLines.Length > 1) { if (this.EditMode == ObjectEditMode.EditMode_New) { string hostsJoined = string.Empty; foreach (string host in computerLines) { hostsJoined += host + ";"; } if (hostsJoined.EndsWith(";")) { hostsJoined = hostsJoined.Substring(0, hostsJoined.LastIndexOf(";")); } textFieldComputerName.StringValue = hostsJoined; CheckIfIsInBulkAddMode(); } else { RmMessageBox.Show(RmMessageBoxType.WarningMessage, this.View.Window, "Warning".TL(), "Bulk-add can only be used when adding new connections.".TL(), "OK".TL()); } } } }