Skip to content

feat: Get and Set lines#918

Open
sunamo wants to merge 9 commits into
CopyText:mainfrom
sunamo:main
Open

feat: Get and Set lines#918
sunamo wants to merge 9 commits into
CopyText:mainfrom
sunamo:main

Conversation

@sunamo

@sunamo sunamo commented Aug 20, 2025

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings August 20, 2025 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds methods to get and set multi-line text data from the clipboard by providing convenient array-based APIs. The implementation treats clipboard text as lines that can be split and joined using standard line terminators.

  • Adds GetLines() and GetLinesAsync() methods that retrieve clipboard text and split it into string arrays
  • Adds SetLines() and SetLinesAsync() methods that join string arrays and set them as clipboard text
  • Uses standard line separators (\r\n, \r, \n) for splitting and Environment.NewLine for joining

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

/// Clears the Clipboard and then adds lines of text data to it.
/// </summary>
public static Task SetLinesAsync(string[] lines, Cancellation cancellation = default)
{

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should validate that the lines parameter is not null to prevent a NullReferenceException when calling string.Join().

Suggested change
{
{
if (lines == null)
throw new ArgumentNullException(nameof(lines));

Copilot uses AI. Check for mistakes.
/// Clears the Clipboard and then adds lines of text data to it.
/// </summary>
public static void SetLines(string[] lines)
{

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should validate that the lines parameter is not null to prevent a NullReferenceException when calling string.Join().

Suggested change
{
{
if (lines == null)
throw new ArgumentNullException(nameof(lines));

Copilot uses AI. Check for mistakes.
smutekutek and others added 6 commits June 6, 2026 13:53
# Conflicts:
#	src/Directory.Build.props
# Conflicts:
#	src/TextCopy.sln
Repo bylo prevedeno na TextCopy.slnx, ale build.ps1 stale odkazoval
na stary .sln soubor a volal msbuild.exe, ktery na macOS/Linux
AppVeyor runnerech neexistuje - vsechny 3 joby proto selhavaly.
Zaroven vraceno omylem prejmenovane src/.editorconfig2 zpet na
.editorconfig (bylo zpusobeno merge konfliktem).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ee slozkam (#1)

Co-authored-by: smutekutek <smutekutek@gmail.com>
AppVeyor bezi na MSBuild 17.8.3 - jeho legacy solution parser neumi
novy XML format .slnx (MSB4068: element <Solution> unrecognized).
dotnet CLI prikazy (restore/build/pack) maji vlastni slnx-aware
solution loader nezavisly na teto starsi verzi MSBuild.
Predchozi fix (dotnet build/restore/pack misto dotnet msbuild -t:)
nepomohl - macOS/Ubuntu AppVeyor obrazy maji starsi .NET SDK, jehoz
MSBuild neumi zpracovat novy XML format .slnx vubec (MSB4068:
element <Solution> unrecognized), bez ohledu na to jestli se vola
pres 'dotnet msbuild' nebo 'dotnet build'. Reseni: stavet primo proti
TextCopy.csproj a Tests.csproj, cimz se parsovani slnx uplne obejde
a zaroven se vynechaji nesouvisejici ukazkove projekty (AndroidApp,
BlazorSample, UapApp, iOSApp, TestConsole), ktere uz maji vlastni
nezavisle problemy s balicky (NU1009/NU1202).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants